11,572 questions
Check if this query corresponds to guessed expectations:
var q = panelInfoModels.Where( p => p.UUTInfo.All( i => !i.Exists ) ).ToList( );
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I haven't used LINQ for a while and things got forgotten.
How would one filter panelInfoModels by Exists value? The query below returns the same collection (does not apply intended filtering).
var q = (from p in panelInfoModels
from u in p.UUTInfo
where u.Exists == false
select p).ToList();
public class PanelInfoModel
{
public string Sn { get; set; }
public List<SubPanelInfoModel> SubPanelInfo { get; set; }
public List<UUTInfoModel> UUTInfo { get; set; }
}
public class SubPanelInfoModel
{
public string Sn { get; set; }
public int Sequence { get; set; }
public List<UUTInfoModel> UUTInfo { get; set; }
}
public class UUTInfoModel
{
public string Sn { get; set; }
public int Sequence { get; set; }
public bool Exists { get; set; } = false;
}
Thanks
Check if this query corresponds to guessed expectations:
var q = panelInfoModels.Where( p => p.UUTInfo.All( i => !i.Exists ) ).ToList( );