2022-05-09 22:38:14 -07:00
|
|
|
using System.Reflection;
|
2022-05-09 14:41:15 -07:00
|
|
|
using Core.Entities;
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
2022-05-09 18:31:09 -07:00
|
|
|
namespace Infrastructure.Data
|
2022-05-09 14:41:15 -07:00
|
|
|
{
|
|
|
|
public class StoreContext : DbContext
|
|
|
|
{
|
|
|
|
public StoreContext(DbContextOptions<StoreContext> options) : base(options)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
public DbSet<Product> Products { get; set; }
|
2022-05-09 17:07:59 -07:00
|
|
|
public DbSet<ProductBrand> ProductBrands { get; set; }
|
|
|
|
public DbSet<ProductType> ProductTypes { get; set; }
|
2022-05-09 22:38:14 -07:00
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
|
|
{
|
|
|
|
base.OnModelCreating(modelBuilder);
|
|
|
|
modelBuilder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());
|
|
|
|
}
|
2022-05-09 14:41:15 -07:00
|
|
|
}
|
|
|
|
}
|