Sky.Net/Infrastructure/Data/StoreContext.cs
2022-05-09 22:38:14 -07:00

21 lines
686 B
C#

using System.Reflection;
using Core.Entities;
using Microsoft.EntityFrameworkCore;
namespace Infrastructure.Data
{
public class StoreContext : DbContext
{
public StoreContext(DbContextOptions<StoreContext> options) : base(options)
{
}
public DbSet<Product> Products { get; set; }
public DbSet<ProductBrand> ProductBrands { get; set; }
public DbSet<ProductType> ProductTypes { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());
}
}
}