mirror of
https://github.com/dotnetcore/Util.git
synced 2026-10-29 11:36:32 +08:00
28 lines
929 B
C#
28 lines
929 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
using Util.Samples.Domain.Models;
|
|
|
|
namespace Util.Samples.Data.Mappings.Systems.MySql {
|
|
/// <summary>
|
|
/// 应用程序映射配置
|
|
/// </summary>
|
|
public class ApplicationMap : Util.Datas.Ef.MySql.AggregateRootMap<Application> {
|
|
/// <summary>
|
|
/// 映射表
|
|
/// </summary>
|
|
protected override void MapTable( EntityTypeBuilder<Application> builder ) {
|
|
builder.ToTable( "Systems.Application" );
|
|
}
|
|
|
|
/// <summary>
|
|
/// 映射属性
|
|
/// </summary>
|
|
protected override void MapProperties( EntityTypeBuilder<Application> builder ) {
|
|
//应用程序编号
|
|
builder.Property(t => t.Id)
|
|
.HasColumnName("ApplicationId");
|
|
builder.HasQueryFilter( t => t.IsDeleted == false );
|
|
}
|
|
}
|
|
}
|