You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
usingvarcontext=awaitcontextFactory.CreateDbContextAsync();context.Add(newExtendedAddress{AddressId=$"{nameof(Address)}-1",City="Salt Lake City",State="Utah",Street="Course Road",HouseNumber="1234"});awaitcontext.SaveChangesAsync();
Then in a separate method, I do:
usingvarcontext=awaitcontextFactory.CreateDbContextAsync();varaddress=awaitcontext.Addresses.FindAsync($"{nameof(Address)}-1");varaddressEntry=context.Entry(address);varaddressETagPropertyName=addressEntry.Metadata.GetETagPropertyName();// we expect a value, but addressETagPropertyName is null.varaddressETagProperty=addressEntry.Metadata.GetETagProperty();// we expect a value, but addressETagProperty is nulladdress.Street="Street from context 1";awaitcontext1.SaveChangesAsync();
At this point I expect that address.CustomETag contains an updated value from db, but the value is not updated.
If I do the same test but with Address entity, everything works as expected and described in the documentation.
Provider and version information
EF Core version: 8.0.10
Database provider: Microsoft.EntityFrameworkCore.Cosmos 8.0.10
Target framework: .NET 8.0
Operating system:
IDE: (e.g. Visual Studio 2022 17.4)
I also tested this using .NET 6.0 and EF Core 6, and also using >NET 8.0 EF Core 9.0
The text was updated successfully, but these errors were encountered:
EF Core for Cosmos DB does not support ETag for derived entities.
I defined the model:
I configured DbContext:
I added a record to the db:
Then in a separate method, I do:
At this point I expect that address.CustomETag contains an updated value from db, but the value is not updated.
If I do the same test but with Address entity, everything works as expected and described in the documentation.
Provider and version information
EF Core version: 8.0.10
Database provider: Microsoft.EntityFrameworkCore.Cosmos 8.0.10
Target framework: .NET 8.0
Operating system:
IDE: (e.g. Visual Studio 2022 17.4)
I also tested this using .NET 6.0 and EF Core 6, and also using >NET 8.0 EF Core 9.0
The text was updated successfully, but these errors were encountered: