From 7c33b3f334cf91918add7af08866f2ea37ed9c3f Mon Sep 17 00:00:00 2001 From: Melodi <62381002+Melodi17@users.noreply.github.com> Date: Thu, 3 Sep 2026 23:06:05 +1000 Subject: chore: initial commit --- src/marlin.web/Data/ApplicationDbContext.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/marlin.web/Data/ApplicationDbContext.cs (limited to 'src/marlin.web/Data') diff --git a/src/marlin.web/Data/ApplicationDbContext.cs b/src/marlin.web/Data/ApplicationDbContext.cs new file mode 100644 index 0000000..41ec4bc --- /dev/null +++ b/src/marlin.web/Data/ApplicationDbContext.cs @@ -0,0 +1,25 @@ +namespace marlin.web.Data; + +using System.Linq.Expressions; +using core; +using core.models; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +public class ApplicationDbContext : DbContext +{ + public DbSet Sources => this.Set(); + public DbSet Jobs => this.Set(); + + public ApplicationDbContext(DbContextOptions options) + : base(options) { } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder + .Entity() + .OwnsOne(p => p.Capabilities, b => b.ToJson()); + + base.OnModelCreating(modelBuilder); + } +} \ No newline at end of file -- cgit v1.3.1