| | |
| | | using System; |
| | | using Furion.DatabaseAccessor; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Microsoft.EntityFrameworkCore.Metadata.Builders; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace FlexJobApi.Core |
| | | { |
| | | public class TaskInfoCredentialLimit : CommonEntity |
| | | public class TaskInfoCredentialLimit : CommonEntity, IEntityTypeBuilder<TaskInfoCredentialLimit> |
| | | { |
| | | /// <summary> |
| | | /// 任务Id |
| | |
| | | public TaskInfo TaskInfo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 证书类型Id |
| | | /// 证书类型编号 |
| | | /// </summary> |
| | | public Guid? TypeId { get; set; } |
| | | [Required] |
| | | public string TypeCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 证书类型 |
| | | /// </summary> |
| | | public DictionaryData Type { get; set; } |
| | | |
| | | public void Configure(EntityTypeBuilder<TaskInfoCredentialLimit> entityBuilder, DbContext dbContext, Type dbContextLocator) |
| | | { |
| | | entityBuilder |
| | | .HasOne(it => it.Type) |
| | | .WithMany() |
| | | .HasForeignKey(it => it.TypeCode) |
| | | .HasPrincipalKey(it => it.Code) |
| | | .IsRequired() |
| | | .OnDelete(DeleteBehavior.Restrict); |
| | | } |
| | | } |
| | | } |