using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using Util.Samples.Domain.Models; namespace Util.Samples.Data.Mappings.Systems.Oracle { /// /// 角色映射配置 /// public class RoleMap : Util.Datas.Ef.Oracle.AggregateRootMap { /// /// 映射表 /// protected override void MapTable( EntityTypeBuilder builder ) { builder.ToTable( "Role", "Systems" ); } /// /// 映射属性 /// protected override void MapProperties( EntityTypeBuilder builder ) { builder.Property( t => t.Id ).HasColumnName( "RoleId" ); builder.Property( t => t.Path ).HasColumnName( "Path" ); builder.Property( t => t.Level ).HasColumnName( "Level" ); builder.Property( t => t.IsAdmin ).HasColumnName( "IsAdmin" ); builder.HasQueryFilter( t => t.IsDeleted == false ); } } }