diff options
Diffstat (limited to 'api/WhatApi/Tables/Content.cs')
| -rw-r--r-- | api/WhatApi/Tables/Content.cs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/api/WhatApi/Tables/Content.cs b/api/WhatApi/Tables/Content.cs index 79f2579..0b26b82 100644 --- a/api/WhatApi/Tables/Content.cs +++ b/api/WhatApi/Tables/Content.cs @@ -2,11 +2,23 @@ using System.Net; namespace WhatApi.Tables; -public class Content +public class Content : IAuditableEntity { public Guid Id { get; set; } - public string Mime { get; set; } - public DateTime Created { get; set; } + public required string Mime { get; set; } public Guid BlobId { get; set; } - public IPAddress Ip { get; set; } + public required IPAddress Ip { get; set; } + public DateTimeOffset CreatedAtUtc { get; set; } + public DateTimeOffset? UpdatedAtUtc { get; set; } + public Guid CreatedBy { get; set; } + public Guid? UpdatedBy { get; set; } +} + +public class ContentConfiguration : IEntityTypeConfiguration<Content> +{ + public void Configure(EntityTypeBuilder<Content> builder) { + builder.HasKey(x => x.Id); + builder.Property(x => x.Mime).HasMaxLength(100).IsRequired(); + builder.ToTable("content"); + } }
\ No newline at end of file |
