0
0
MyDarling/Models/DataContext.cs

20 lines
512 B
C#
Raw Normal View History

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-06-03 07:41:46 +03:00
public DbSet<Product> Products => Set<Product>();
2023-01-31 15:55:44 +03:00
public DbSet<Figure> Figures => Set<Figure>();
}
}