2023-01-31 15:55:44 +03:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
namespace MyDarling.Models
|
|
|
|
{
|
|
|
|
public class DataContext : DbContext
|
|
|
|
{
|
|
|
|
protected readonly IConfiguration configuration;
|
|
|
|
public DataContext(IConfiguration configuration)
|
|
|
|
{
|
|
|
|
this.configuration = configuration;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder opts)
|
|
|
|
{
|
|
|
|
opts.UseSqlite(configuration.GetConnectionString("MyDarlingDb"));
|
|
|
|
}
|
|
|
|
|
2023-02-01 09:26:53 +03:00
|
|
|
// protected override void OnModelCreating(ModelBuilder builder)
|
|
|
|
// {
|
|
|
|
// builder.Entity<UnderwearBundle>().HasMany(b => b.Figures).WithOne();
|
|
|
|
// }
|
2023-02-01 07:49:31 +03:00
|
|
|
|
2023-01-31 15:55:44 +03:00
|
|
|
public DbSet<UnderwearBundle> UnderwearBundles => Set<UnderwearBundle>();
|
|
|
|
public DbSet<Figure> Figures => Set<Figure>();
|
|
|
|
}
|
|
|
|
}
|