Project/Project.Infrastructure/ApplicationDbContext.cs
2024-06-28 15:15:15 +02:00

27 lines
747 B
C#

using Microsoft.EntityFrameworkCore;
using Project.Domain.Entities;
namespace Project.Infrastructure
{
public class ApplicationDbContext : DbContext
{
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options)
{
}
public DbSet<User> Users { get; set; }
public DbSet<Role> Roles { get; set; }
public DbSet<Product> Products { get; set; }
public DbSet<Category> Categories { get; set; }
public DbSet<CategoryRole> CategoriesRoles { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<User>();
}
}
}