summaryrefslogtreecommitdiff
path: root/Models/DataContext.cs
blob: 9fd10e052bc28f79977391dab210af3e9aa29374 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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<Product> Products => Set<Product>();
		public DbSet<Figure> Figures => Set<Figure>();
	}
}