using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using Util.Samples.Domain.Models; namespace Util.Samples.Data.Mappings.Systems.MySql { /// /// 应用程序映射配置 /// public class ApplicationMap : Util.Datas.Ef.MySql.AggregateRootMap { /// /// 映射表 /// protected override void MapTable( EntityTypeBuilder builder ) { builder.ToTable( "Systems.Application" ); } /// /// 映射属性 /// protected override void MapProperties( EntityTypeBuilder builder ) { //应用程序编号 builder.Property(t => t.Id) .HasColumnName("ApplicationId"); builder.HasQueryFilter( t => t.IsDeleted == false ); } } }