media upload
This commit is contained in:
parent
befaa207d7
commit
0d7da2ea85
33 changed files with 257 additions and 353 deletions
|
@ -1,16 +1,15 @@
|
|||
using Femto.Modules.Media.Infrastructure.Integration;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Femto.Modules.Media.Data;
|
||||
|
||||
internal class MediaContext(DbContextOptions<MediaContext> options) : DbContext(options)
|
||||
{
|
||||
public virtual DbSet<OutboxEntry> Outbox { get; set; }
|
||||
public virtual DbSet<SavedBlob> SavedBlobs { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
{
|
||||
base.OnModelCreating(builder);
|
||||
builder.HasDefaultSchema("blog");
|
||||
builder.HasDefaultSchema("media");
|
||||
builder.ApplyConfigurationsFromAssembly(typeof(MediaContext).Assembly);
|
||||
}
|
||||
}
|
22
Femto.Modules.Media/Data/SavedBlob.cs
Normal file
22
Femto.Modules.Media/Data/SavedBlob.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Femto.Modules.Media.Data;
|
||||
|
||||
[Table("saved_blob")]
|
||||
internal class SavedBlob
|
||||
{
|
||||
public Guid Id { get; private set; }
|
||||
public DateTime CreatedOn { get; private set; }
|
||||
public string Type { get; private set; }
|
||||
public long? Size { get; private set; }
|
||||
|
||||
public SavedBlob(Guid id, string type, long? size)
|
||||
{
|
||||
Id = id;
|
||||
CreatedOn = DateTime.UtcNow;
|
||||
Type = type;
|
||||
Size = size;
|
||||
}
|
||||
|
||||
private SavedBlob() { }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue