I'm working with a bounch of entities each of them having several properties. Each property is involved in optimistic concurrency check on saving. I prefer avoid using of timestamp as I should add the field on each tables, Im working with a legacy database and I don't want to make any changes on it. The solution adopted rely on calling IsConcurrencyToken in the modelBuilder
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<MyEntity1>(entity =>
{
entity.Property(e => e.Property1).IsConcurrencyToken;
entity.Property(e => e.Property2).IsConcurrencyToken;
entity.Property(e => e.Property3).IsConcurrencyToken;
entity.Property(e => e.PropertyN).IsConcurrencyToken;
});
}
but do I really need to explicitly call IsConcurrencyToken for every properties? Is there any chance to configure my entities to automatically include every properties in the concurrency check?