diff --git a/src/WorkFlow.Domain/Entities/PObjectState.cs b/src/WorkFlow.Domain/Entities/PObjectState.cs index 82a50f6..bb9e398 100644 --- a/src/WorkFlow.Domain/Entities/PObjectState.cs +++ b/src/WorkFlow.Domain/Entities/PObjectState.cs @@ -83,4 +83,6 @@ public class PObjectState public virtual State? State1 { get; set; } public virtual IEnumerable? TFControls { get; set; } + + public virtual IEnumerable? TfFiles { get; set; } } \ No newline at end of file diff --git a/src/WorkFlow.Infrastructure/Repositories/PObjectRepository.cs b/src/WorkFlow.Infrastructure/Repositories/PObjectRepository.cs index 7f16086..e466fb3 100644 --- a/src/WorkFlow.Infrastructure/Repositories/PObjectRepository.cs +++ b/src/WorkFlow.Infrastructure/Repositories/PObjectRepository.cs @@ -37,6 +37,7 @@ public class PObjectRepository : IProfileObjRepository .FromSqlRaw("SELECT * FROM [FNMWF_GET_PROFILE_OBJECTS] ({0}, {1})", userId, profileId) .Include(obj => obj.State).ThenInclude(objState => objState != null ? objState.State1 : null) .Include(obj => obj.State).ThenInclude(objState => objState != null ? objState.TFControls : null) - .Include(obj => obj.StateHistories).ThenInclude(hist => hist != null ? hist.State1 : null) + .Include(obj => obj.State).ThenInclude(objState => objState != null ? objState.TfFiles : null) + .Include(obj => obj.StateHistories!).ThenInclude(hist => hist != null ? hist.State1 : null) .ToListAsync(cancel); } \ No newline at end of file diff --git a/src/WorkFlow.Infrastructure/WFDBContext.cs b/src/WorkFlow.Infrastructure/WFDBContext.cs index b7af9eb..b92479c 100644 --- a/src/WorkFlow.Infrastructure/WFDBContext.cs +++ b/src/WorkFlow.Infrastructure/WFDBContext.cs @@ -52,6 +52,11 @@ public class WFDBContext : DbContext, IUserManagerDbContext .HasForeignKey(control => control.ObjStateId) .OnDelete(DeleteBehavior.Cascade); + modelBuilder.Entity() + .HasMany(objState => objState.TfFiles) + .WithOne() + .HasForeignKey(file => file.ObjStateId); + modelBuilder.Entity() .HasMany(p => p.StateHistories) .WithOne()