Support for custom ETag?
We are using EF Core with MS SqlServer and an own ETag field (GUID). I guess that I could add a RowVersion field (and opt out of the concurrency check), but we already have mid-air conflicts logic based on our ETag in our API clients, and I am afraid this will interfere with Delta's concepts. Would it be possible to use that ETag instead of the calculated one?
we already have mid-air conflicts logic based on our ETag in our API clients
if you already have code to handle this, why r u considering Delta?
We just populate the ETag and use it only for mid-air collision detection during save. I am tempted by Delta's offering on caching.
I second this. We have a "LastModified"- Column in place which is basically a DATETIME2 based timestamp. Would be nice to be able to configure this column as the "ETAG" to be used.
@NicoKno the complexity in that Delta does not use "a column". it uses a db level timestamp. to use a LastModified u would need to query all tables to find the newest last modified
Sorry for my the misunderstanding. But isn't the RowVersion a db table column either? Sorry for bothering, I have to do a little more reading on that topic.
I am considering also "the other way around" in our case. Ditching our ETag (a shadow prop of type GUID, that we don't use for concurrency anyway), and using your default ETag. Then we would get the best of "both worlds" (our mid-air collision logic is not depending on a GUID as ETag, it can be anything).
RowVersion is per table. but because it is a special type of column, sql has a feature that allows you to query the newest RowVersion across all tables. and it a very efficient query, since it is actually implement as a db level counter. so the query is just "what the current counter value"
if you dont already use a row version for concurrency, i highly recommend it. here is an example ef usage https://learn.microsoft.com/en-us/aspnet/core/data/ef-mvc/concurrency?view=aspnetcore-9.0