using Furion.DatabaseAccessor;
|
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace FlexJobApi.Core
|
{
|
/// <summary>
|
/// 用户信息期望岗位
|
/// </summary>
|
public class UserExpectJob : CommonEntity<MasterDbContextLocator>, IEntityTypeBuilder<UserExpectJob>
|
{
|
/// <summary>
|
/// 用户信息Id
|
/// </summary>
|
public Guid UserId { get; set; }
|
|
/// <summary>
|
/// 用户信息
|
/// </summary>
|
public User User { get; set; }
|
|
/// <summary>
|
/// 期望岗位编号
|
/// </summary>
|
public string ExpectJobCode { get; set; }
|
|
/// <summary>
|
/// 期望岗位
|
/// </summary>
|
public DictionaryData ExpectJob { get; set; }
|
|
public void Configure(EntityTypeBuilder<UserExpectJob> entityBuilder, DbContext dbContext, Type dbContextLocator)
|
{
|
entityBuilder
|
.HasOne(it => it.ExpectJob)
|
.WithMany()
|
.HasForeignKey(it => it.ExpectJobCode)
|
.HasPrincipalKey(it => it.Code)
|
.IsRequired()
|
.OnDelete(DeleteBehavior.Restrict);
|
}
|
}
|
}
|