Files

17 lines
502 B
C#
Raw Permalink Normal View History

2026-08-13 23:10:22 +07:00
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
2026-08-19 23:25:08 +07:00
using mws.backend.dotnet.domain.Roles;
2026-08-13 23:10:22 +07:00
2026-08-19 23:25:08 +07:00
namespace mws.backend.dotnet.infrastructure.Persistence.Configuration;
2026-08-13 23:10:22 +07:00
public class RoleConfiguration : IEntityTypeConfiguration<Role>
{
public void Configure(EntityTypeBuilder<Role> e)
{
e.ToTable("roles");
e.HasKey(r => r.Id);
e.Property(r => r.Name).HasMaxLength(100).IsRequired();
e.HasIndex(r => r.Name).IsUnique();
}
}