From a9860b28f2be123d1f0bfad504165992a4c841ed Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Tue, 10 Jan 2023 21:46:03 +0100 Subject: feat: feat --- BlobBin/DB.cs | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 BlobBin/DB.cs (limited to 'BlobBin/DB.cs') diff --git a/BlobBin/DB.cs b/BlobBin/DB.cs new file mode 100644 index 0000000..5146304 --- /dev/null +++ b/BlobBin/DB.cs @@ -0,0 +1,41 @@ +using Microsoft.EntityFrameworkCore; + +namespace BlobBin; + +public class DB : DbContext +{ + public DB(DbContextOptions options) : base(options) { } + + public DbSet Files { get; set; } + public DbSet Pastes { get; set; } +} + +public class UploadEntityBase +{ + public UploadEntityBase() { + Id = Guid.NewGuid(); + CreatedAt = DateTime.UtcNow; + } + + public Guid Id { get; set; } + public DateTime CreatedAt { get; set; } + public string CreatedBy { get; set; } + public DateTime? DeletedAt { get; set; } + public string? PasswordHash { get; set; } + public bool Singleton { get; set; } + public string? AutoDeleteAfter { get; set; } + public string? MimeType { get; set; } +} + +public class File : UploadEntityBase +{ + public string? Name { get; set; } + public long Length { get; set; } +} + +public class Paste : UploadEntityBase +{ + public string? Name { get; set; } + public string? Content { get; set; } + public long Length { get; set; } +} \ No newline at end of file -- cgit v1.3