summaryrefslogtreecommitdiff
path: root/Models/DataContext.cs
blob: 23e80abc323d651c76675a615b5c9762d7ed4597 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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"));
		}
		
		// protected override void OnModelCreating(ModelBuilder builder)
		// {
		// 	builder.Entity<UnderwearBundle>().HasMany(b => b.Figures).WithOne();			
		// }
		
		public DbSet<UnderwearBundle> UnderwearBundles => Set<UnderwearBundle>();
		public DbSet<Figure> Figures => Set<Figure>();
	}
}