| | | 1 | | using System.ComponentModel.DataAnnotations.Schema; |
| | | 2 | | |
| | | 3 | | namespace ArturRios.Data.Relational.Core.Entities; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Abstract base class for data entities keyed by an identifier of type <typeparamref name="TKey" />. |
| | | 7 | | /// </summary> |
| | | 8 | | /// <typeparam name="TKey">The primary key type, e.g. <see cref="long" />, <see cref="Guid" /> or <see cref="string" />. |
| | | 9 | | public abstract class Entity<TKey> where TKey : IEquatable<TKey> |
| | | 10 | | { |
| | | 11 | | /// <summary> |
| | | 12 | | /// The unique identifier for the entity. |
| | | 13 | | /// </summary> |
| | | 14 | | [Column(Order = 1)] |
| | 144 | 15 | | public TKey Id { get; set; } = default!; |
| | | 16 | | } |