From cd70f54266d708867a1eb35870bc755bc5b2df32 Mon Sep 17 00:00:00 2001 From: ivar Date: Wed, 3 Dec 2025 21:49:20 +0100 Subject: Refactor db --- api/WhatApi/Database/Tables/Content.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 api/WhatApi/Database/Tables/Content.cs (limited to 'api/WhatApi/Database/Tables/Content.cs') diff --git a/api/WhatApi/Database/Tables/Content.cs b/api/WhatApi/Database/Tables/Content.cs new file mode 100644 index 0000000..8148f81 --- /dev/null +++ b/api/WhatApi/Database/Tables/Content.cs @@ -0,0 +1,20 @@ +using System.Net; + +namespace WhatApi.Database.Tables; + +public class Content : BaseAuditableEntity +{ + public Guid Id { get; set; } + public required string Mime { get; set; } + public Guid BlobId { get; set; } + public required IPAddress Ip { get; set; } +} + +public class ContentConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) { + builder.HasKey(x => x.Id); + builder.Property(x => x.Mime).HasMaxLength(100).IsRequired(); + builder.ToTable("content"); + } +} \ No newline at end of file -- cgit v1.3