using Aurora.Common.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
namespace Aurora.Tenant.EntityFramework.EntitiesConfig
{
///
/// 对父类领域实体配置
///
///
public abstract class BaseEntityTypeConfiguration : IEntityTypeConfiguration
where T : class, ITenantEntity
{
public void Configure(EntityTypeBuilder builder)
{
builder.Property(x => x.TenantCode).HasMaxLength(100);
builder.HasKey(x => new { x.TenantCode, x.ID });
// builder.HasIndex(x => new { x.TenantCode, x.ID });
// builder.Property(x => x.RowCreatedBy).HasMaxLength(100);
// builder.Property(x => x.RowUpdatedBy).HasMaxLength(100);
Map(builder);
}
///
/// 强行让子类实现自己配置
///
///
public abstract void Map(EntityTypeBuilder builder);
}
}