mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-06-29 18:21:08 +00:00
21 lines
619 B
C#
21 lines
619 B
C#
using CleanArchitecture.Domain.Constants;
|
|
using CleanArchitecture.Domain.Entities;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace CleanArchitecture.Infrastructure.Configurations;
|
|
|
|
public sealed class TenantConfiguration : IEntityTypeConfiguration<Tenant>
|
|
{
|
|
public void Configure(EntityTypeBuilder<Tenant> builder)
|
|
{
|
|
builder
|
|
.Property(user => user.Name)
|
|
.IsRequired()
|
|
.HasMaxLength(MaxLengths.Tenant.Name);
|
|
|
|
builder.HasData(new Tenant(
|
|
Ids.Seed.TenantId,
|
|
"Admin Tenant"));
|
|
}
|
|
} |