| | | 1 | | using System.ComponentModel.DataAnnotations; |
| | | 2 | | |
| | | 3 | | namespace ArturRios.Data.Relational.Core.Entities; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Base class for entities keyed by <typeparamref name="TKey" /> that participate in optimistic |
| | | 7 | | /// concurrency checks. The <see cref="ConcurrencyStamp" /> is regenerated on every update by the context, |
| | | 8 | | /// so a stale value causes the update to fail with a concurrency conflict. |
| | | 9 | | /// </summary> |
| | | 10 | | /// <typeparam name="TKey">The primary key type.</typeparam> |
| | | 11 | | public abstract class VersionedEntity<TKey> : Entity<TKey>, IVersionedEntity where TKey : IEquatable<TKey> |
| | | 12 | | { |
| | | 13 | | /// <inheritdoc /> |
| | | 14 | | [ConcurrencyCheck] |
| | 134 | 15 | | public Guid ConcurrencyStamp { get; set; } = Guid.NewGuid(); |
| | | 16 | | } |