Data Annotations

Data Annotations DatabaseGenerated Attribute in Entity Framework
Entity Framework Core

DatabaseGenerated Attribute EF Core

Use DatabaseGenerated Attribute on a property whose value is automatically generated by the Database. This attribute is part of the System.ComponentModel.DataAnnotations.Schema Namespace. This attribute works both in Entity framework & EF Core

Data Annotations Timestamp attribute in Entity Framework Code First
Entity Framework Core

Timestamp Attribute in EF Core

Using Timestamp Attribute is a way to handle the Concurrency issues. The Concurrency issue arises when multiple users attempt to update/delete the same row at the same time. This issue can be handled either by using the Timestamp column or ConcurrencyCheck attribute on the property. Timestamp columns are the preferred way of using for concurrency check. This attribute is available in both Entity Framework & Entity Framework Core

Data-Annotations-ConcurrencyCheck-Attribute
Entity Framework Core

Data Annotations ConcurrencyCheck EF Core

Concurrency Check used to handle conflicts that result when multiple users are updating (or deleting) the table at the same time. You can add the ConcurrencyCheck attribute on any property, which you want to participate in the Concurrency Check. This attribute works the same way in both EF 6 & EF Core.

Scroll to Top