NonInventPurchasingSystem/CPRNIMS.Infrastructure/Database/AuhorizationDbContext.cs
2026-01-20 07:44:30 +08:00

27 lines
907 B
C#

using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.AspNetCore.Identity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CPRNIMS.Infrastructure.Entities.Account;
using Microsoft.EntityFrameworkCore;
namespace CPRNIMS.Infrastructure.Database
{
public class AuhorizationDbContext : IdentityDbContext<IdentityUser>
{
public AuhorizationDbContext(DbContextOptions<AuhorizationDbContext> options) : base(options) { }
public DbSet<AuthorizeRoles> AuthorizeRoles { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<IdentityRole>(entity =>
{
entity.ToTable("Roles"); // Specify the table name for roles
});
}
}
}