feat: Beziehung zwischen „ObjectState“ und „TfFiles“ hinzufügen
This commit is contained in:
parent
26300d8653
commit
b859391ab1
@ -83,4 +83,6 @@ public class PObjectState
|
||||
public virtual State? State1 { get; set; }
|
||||
|
||||
public virtual IEnumerable<PControlsTF>? TFControls { get; set; }
|
||||
|
||||
public virtual IEnumerable<TfFile>? TfFiles { get; set; }
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
@ -52,6 +52,11 @@ public class WFDBContext : DbContext, IUserManagerDbContext
|
||||
.HasForeignKey(control => control.ObjStateId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
modelBuilder.Entity<PObjectState>()
|
||||
.HasMany(objState => objState.TfFiles)
|
||||
.WithOne()
|
||||
.HasForeignKey(file => file.ObjStateId);
|
||||
|
||||
modelBuilder.Entity<PObject>()
|
||||
.HasMany(p => p.StateHistories)
|
||||
.WithOne()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user