-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(RC2) (Test only) Code cleanup (Tests) #34490
Conversation
/cc @artl93 |
@@ -1525,8 +1524,21 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) | |||
=> modelBuilder.Entity<Customer>( | |||
cb => | |||
{ | |||
cb.HasPartitionKey(c => new { c.PartitionKey1, c.PartitionKey2, c.PartitionKey3 }); | |||
cb.HasKey(c => new { c.Id, c.PartitionKey1, c.PartitionKey2, c.PartitionKey3 }); | |||
cb.HasPartitionKey( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am sad about these (doesn't seem like they reach our line char limit) but whatever
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our rules say we always expand these. Not a fan of it either.
test/EFCore.Cosmos.FunctionalTests/Query/InheritanceQueryCosmosFixture.cs
Outdated
Show resolved
Hide resolved
test/EFCore.Cosmos.FunctionalTests/Query/InheritanceQueryCosmosFixture.cs
Outdated
Show resolved
Hide resolved
@@ -371,28 +371,28 @@ private static List<SinglePartitionKeyEntity> CreateSinglePartitionKeyEntities() | |||
private static List<OnlyHierarchicalPartitionKeyEntity> CreateOnlyHierarchicalPartitionKeyEntities() | |||
=> new() | |||
{ | |||
new() | |||
new OnlyHierarchicalPartitionKeyEntity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My preference on these would be to explicitly specify the list type (new List<OnlyHierarchyPartitionKeyEntity>()
just above) and then use target-typed new in the elements - hopefully the editorconfig setting allows for that... But no need to block this PR for that.
@@ -384,7 +384,7 @@ protected override Task SeedAsync(PoolableDbContext context) | |||
NestedOwned = new Owned2 { Prop = "7" }, | |||
NestedOwnedCollection = new List<Owned2> { new() { Prop = "71" }, new() { Prop = "72" } } | |||
}, | |||
OwnedCollection = new List<Owned1> { new Owned1 { Prop = 71 }, new Owned1 { Prop = 72 } } | |||
OwnedCollection = new List<Owned1> { new() { Prop = 71 }, new() { Prop = 72 } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With regards to my comment above on target-typed, this is how I think it should be - explicitly type the list, implicitly the elements in the initializer...
bb1465d
to
bb1607a
Compare
Plus some test refactoring to make cleanup go smoother next time.