c# - How to check null collection? -
i have algorithm select data collection of reportdata
private idictionary<guid, jobstatistic> getagentsstatistics(ilist<guid> agentids) { var agentreportitems = data in reportdata agentid in data.agentids agentids.contains(agentid) group data agentid; ... }
but if agentids empty collection? how check situation?
var agentreportitems = data in reportdata agentid in data.agentids agentids != null && agentids.contains(agentid) group data agentid;
just check if it's null, , if it's not, use did.
Comments
Post a Comment