using Furion.DatabaseAccessor; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; namespace Dilon.Core { /// /// 员工附属机构职位表 /// [Table("sys_emp_ext_org_pos")] [Comment("员工附属机构职位表")] public class SysEmpExtOrgPos : IEntity, IEntityTypeBuilder, IEntitySeedData { /// /// 员工Id /// [Comment("员工Id")] public long SysEmpId { get; set; } /// /// 一对一引用(员工) /// public SysEmp SysEmp { get; set; } /// /// 机构Id /// [Comment("机构Id")] public long SysOrgId { get; set; } /// /// 一对一引用(机构) /// public SysOrg SysOrg { get; set; } /// /// 职位Id /// [Comment("职位Id")] public long SysPosId { get; set; } /// /// 一对一引用(职位) /// public SysPos SysPos { get; set; } public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator) { entityBuilder.HasKey(c => new { c.SysEmpId, c.SysOrgId, c.SysPosId }); } public IEnumerable HasData(DbContext dbContext, Type dbContextLocator) { return new[] { new SysEmpExtOrgPos { SysEmpId = 142307070910551, SysOrgId = 142307070910539, SysPosId = 142307070910547 }, new SysEmpExtOrgPos { SysEmpId = 142307070910551, SysOrgId = 142307070910540, SysPosId = 142307070910548 }, new SysEmpExtOrgPos { SysEmpId = 142307070910551, SysOrgId = 142307070910541, SysPosId = 142307070910549 }, new SysEmpExtOrgPos { SysEmpId = 142307070910551, SysOrgId = 142307070910542, SysPosId = 142307070910550 }, new SysEmpExtOrgPos { SysEmpId = 142307070910553, SysOrgId = 142307070910542, SysPosId = 142307070910547 } }; } } }