25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.5KB

  1. using CartWise.Application.Interfaces;
  2. using CartWise.Domain.Entities;
  3. using CartWise.Infrastructure.Identity;
  4. using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
  5. using Microsoft.EntityFrameworkCore;
  6. namespace CartWise.Infrastructure.Data;
  7. public class CartWiseDbContext : IdentityDbContext<ApplicationUser>, IApplicationDbContext
  8. {
  9. public CartWiseDbContext(DbContextOptions<CartWiseDbContext> options)
  10. : base(options)
  11. {
  12. }
  13. public DbSet<Household> Households => Set<Household>();
  14. public DbSet<HouseholdMember> HouseholdMembers => Set<HouseholdMember>();
  15. public DbSet<ProductCategory> ProductCategories => Set<ProductCategory>();
  16. public DbSet<GroceryConcept> GroceryConcepts => Set<GroceryConcept>();
  17. public DbSet<ShoppingList> ShoppingLists => Set<ShoppingList>();
  18. public DbSet<ShoppingListItem> ShoppingListItems => Set<ShoppingListItem>();
  19. public DbSet<Brand> Brands => Set<Brand>();
  20. public DbSet<Product> Products => Set<Product>();
  21. public DbSet<ProductIdentifier> ProductIdentifiers => Set<ProductIdentifier>();
  22. public DbSet<HouseholdProductPreference> HouseholdProductPreferences => Set<HouseholdProductPreference>();
  23. public DbSet<Retailer> Retailers => Set<Retailer>();
  24. public DbSet<StoreLocation> StoreLocations => Set<StoreLocation>();
  25. protected override void OnModelCreating(ModelBuilder builder)
  26. {
  27. base.OnModelCreating(builder);
  28. builder.ApplyConfigurationsFromAssembly(typeof(CartWiseDbContext).Assembly);
  29. }
  30. }

Powered by TurnKey Linux.