feat(aihitRelationshipsSyncer): Реализована логика синхронизации связей между Unit+CI/CD
This commit is contained in:
@@ -31,5 +31,18 @@ namespace PARR.DAL.Models.Unit
|
||||
public ICollection<UnitInField> UnitFields { get; set; } = new HashSet<UnitInField>();
|
||||
|
||||
public ICollection<UnitInValue> UnitValues { get; set; } = new HashSet<UnitInValue>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Получить всех родителей
|
||||
/// </summary>
|
||||
[InverseProperty(nameof(UnitInUnit.ChildUnit))]
|
||||
public ICollection<UnitInUnit> ParentUnits { get; set; } = new HashSet<UnitInUnit>();
|
||||
|
||||
/// <summary>
|
||||
/// Получить детей
|
||||
/// </summary>
|
||||
[InverseProperty(nameof(UnitInUnit.ParentUnit))]
|
||||
public ICollection<UnitInUnit> ChildUnits { get; set; } = new HashSet<UnitInUnit>();
|
||||
}
|
||||
}
|
||||
|
||||
30
PARR.DAL/Models/Unit/UnitInUnit.cs
Normal file
30
PARR.DAL/Models/Unit/UnitInUnit.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.DAL.Context;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.DAL.Models.Unit
|
||||
{
|
||||
/// <summary>
|
||||
/// Связи иерархии между ЭК
|
||||
/// </summary>
|
||||
[Table("UnitInUnits", Schema = DataContextSettings.Unit)]
|
||||
[Comment("Таблица связей иерархии между ЭК")]
|
||||
[PrimaryKey(nameof(ParentUnitId), nameof(ChildUnitId))]
|
||||
public class UnitInUnit
|
||||
{
|
||||
public Guid ParentUnitId { get; set; }
|
||||
|
||||
public Guid ChildUnitId { get; set; }
|
||||
|
||||
public DateTimeOffset DateCreated { get; set; }
|
||||
|
||||
public DateTimeOffset? DateSynced { get; set; }
|
||||
|
||||
|
||||
[ForeignKey(nameof(ParentUnitId))]
|
||||
public Unit? ParentUnit { get; set; }
|
||||
|
||||
[ForeignKey(nameof(ChildUnitId))]
|
||||
public Unit? ChildUnit { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user