Files
Nemera/src/Lumina.DataAccess/Common/Configuration/RoleConfiguration.cs
T
BinaryAlley 727aa33318 Formats code comments as sentences in the production sources.
Capitalizes the first word and adds the terminal period across the domain, application, data access, infrastructure, API and web layers and the plugins. No comment is reworded. The change also normalizes the TODO bodies to lowercase, leaves commented-out code untouched, corrects the Threat/Treat typo and the dangling hyphen in the exception middleware, and collapses two accidental repeated terminal periods.
2026-11-16 18:16:17 +02:00

49 lines
1.6 KiB
C#

#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Authorization;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
#endregion
namespace Lumina.DataAccess.Common.Configuration;
/// <summary>
/// Configures the entity mapping for the <see cref="RoleEntity"/> entity.
/// </summary>
public class RoleConfiguration : IEntityTypeConfiguration<RoleEntity>
{
/// <summary>
/// Configures the <see cref="RoleEntity"/> entity.
/// </summary>
/// <param name="builder">The builder to be used to configure the entity.</param>
public void Configure(EntityTypeBuilder<RoleEntity> builder)
{
builder.ToTable("Roles");
builder.HasKey(role => role.Id);
builder.Property(role => role.Id)
.ValueGeneratedOnAdd()
.HasColumnOrder(0);
builder.Property(role => role.RoleName)
.IsRequired()
.HasMaxLength(100)
.HasColumnOrder(1);
// Audit.
builder.Property(role => role.CreatedOnUtc)
.IsRequired()
.HasColumnOrder(3);
builder.Property(role => role.CreatedBy)
.IsRequired()
.HasColumnOrder(4);
builder.Property(role => role.UpdatedOnUtc)
.HasDefaultValue(null)
.HasColumnOrder(5);
builder.Property(role => role.UpdatedBy)
.HasDefaultValue(null)
.HasColumnOrder(6);
}
}