blob: 41ec4bcab2d08dbda91ad359bb6ba539d77eaf81 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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<VersionControlSource> Sources => this.Set<VersionControlSource>();
public DbSet<Job> Jobs => this.Set<Job>();
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
: base(options) { }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder
.Entity<Agent>()
.OwnsOne(p => p.Capabilities, b => b.ToJson());
base.OnModelCreating(modelBuilder);
}
}
|