I have a list like this ( already open with the visual studio debugger ) :
As you can see the list is made up of other objects of the same type list , my need is to run through all the children , regardless by the Index and verify that the FID of that object is the same as the one passed by the UI . Once you found matching server that returns the same object .
i can try this for test, but considering I only top-level items , those with index 0 , does not flow in all:
AttachmentFolders childWithId17 = ApplicationContext.Instance.companyList[0].AttachmentFolders.SelectMany(parent => parent.AttachmentFolder)
.FirstOrDefault(child => child.FID == "835A09A2-9D60-46CC-A2BE-D4CBC4C81860");
another picture to better understand
in fact, I get a list with many elements and should scroll it all , even in responsive manner to be able to return the object that corresponds to that AttachmentFolders FID .
class structure:
public class AttachmentFolders
{
public int id { get; set; }
public String FID { get; set; }
public String Name { get; set; }
public String CPID { get; set; }
public String ParentFID { get; set; }
public List<Attachment> Attachments { get; set; }
public List<AttachmentFolders> AttachmentFolder { get; set; }
}
public class Attachment
{
public int id { get; set; }
public String ATID { get; set; }
public String Name { get; set; }
public String CreatorID { get; set; }
public String FID { get; set; }
public String Extension { get; set; }
public String Description { get; set; }
public int Status { get; set; }
public String CPID { get; set; }
public int FileSize { get; set; }
public DateTime CreationDate { get; set; }
public DateTime ModifiedDate { get; set; }
public int AttachmentType { get; set; }
public int ValidityType { get; set; }
public List<Revisions> Revisions { get; set; }
public String AWID { get; set; }
public String WAID { get; set; }
public String WatermarkPositions { get; set; }
public Boolean Serveroffline { get; set; }
public Boolean IsFavourite { get; set; }
public DateTime LastOpenDate { get; set; }
public int Priority { get; set; }
public String CreatorFirstName { get; set; }
public String CreatorLastName { get; set; }
public String ModifiedByFirstName { get; set; }
public String ModifiedByLastName { get; set; }
public String[] Capabilities { get; set; }
}
Thank you all.