diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2023-01-10 21:46:03 +0100 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2023-01-10 21:46:03 +0100 |
| commit | a9860b28f2be123d1f0bfad504165992a4c841ed (patch) | |
| tree | 12c0683e18cb1efd4dd202d0d011f5902df950c2 /BlobBin/DB.cs | |
| parent | 9d7152b5ca085c70e9b0d94adb6f5f9ff8d6f127 (diff) | |
| download | blob-bin-a9860b28f2be123d1f0bfad504165992a4c841ed.tar.xz blob-bin-a9860b28f2be123d1f0bfad504165992a4c841ed.zip | |
feat: feat
Diffstat (limited to 'BlobBin/DB.cs')
| -rw-r--r-- | BlobBin/DB.cs | 41 |
1 files changed, 41 insertions, 0 deletions
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<DB> options) : base(options) { } + + public DbSet<File> Files { get; set; } + public DbSet<Paste> 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 |
