public static RgDescription GetDescription(RgInventory asset, List <RgDescription> descriptions) { RgDescription description = null; try { description = descriptions .First(item => asset.Instanceid == item.InstanceId && asset.Classid == item.Classid); } catch (Exception ex) when(ex is ArgumentNullException || ex is InvalidOperationException) { } return(description); }
public static RgDescription GetDescription(RgInventory asset, List <RgDescription> descriptions) { return(descriptions.FirstOrDefault( item => asset.Instanceid == item.InstanceId && asset.Classid == item.ClassId)); }