0
0
MyDarling/Models/DataContext.cs
Sergey Chebotar a9e52b199b Database init
2023-01-31 15:55:44 +03:00

21 lines
539 B
C#

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"));
}
public DbSet<UnderwearBundle> UnderwearBundles => Set<UnderwearBundle>();
public DbSet<Figure> Figures => Set<Figure>();
}
}