sunpengfei
2025-08-11 1759ab1a7d3e536eb812dcfbf5a7c8792ed28b2e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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, 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);
        }
    }
}