Would like to both filter and convert a List. Is this the proper syntax? Filter on type and property.
FieldDefEnum1 : FieldDef
List<FileDef> fieldDefs
public List<FieldDefEnum1> FieldDefsEnum1
{
get
{
return FieldDefs.OfType<FieldDefEnum1>().ToList().Where(fd => fd.SysCus == enumSysCus.Cus).ToList();
}
}
This will work fine but you have redundant
.ToList()in the middle that will break deferred execution. try this: