2022-11-18 01:39:36 +03:00
|
|
|
using CodeLiturgy.Data.Application;
|
2022-11-17 01:17:37 +03:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
using BlueWest.EfMethods;
|
|
|
|
|
|
|
|
namespace CodeLiturgy.Domain
|
|
|
|
{
|
|
|
|
[EfGenerator]
|
|
|
|
public class SiteDbContext: DbContext
|
|
|
|
{
|
|
|
|
[EfGetOneBy(nameof(Site.Id), typeof(SiteUnique))]
|
|
|
|
[EfGetOne(typeof(SiteUnique))]
|
|
|
|
[EfGetMany(typeof(SiteUnique))]
|
|
|
|
|
|
|
|
public DbSet<Site> Sites { get; set; }
|
|
|
|
|
2022-11-18 03:15:53 +03:00
|
|
|
public DbSet<SiteEnvironment> Environments { get; set; }
|
|
|
|
|
2022-11-17 01:17:37 +03:00
|
|
|
/// <summary>
|
|
|
|
/// SiteDbContext Constructor.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="options"></param>
|
|
|
|
public SiteDbContext(DbContextOptions<SiteDbContext> options) : base(options)
|
|
|
|
{
|
|
|
|
Database.EnsureCreated();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|