पर linq में शून्य मान को कैसे जांचें I परिणाम प्राप्त करने के लिए निम्न linq को SQL क्वेरी का उपयोग करने का प्रयास कर रहा हूं। लेकिन यह काम करता है अगर parentCategoryId अशक्तएसक्यूएल
public static IEnumerable<Category> GetChildren(this Table<Category> source, int? parentCategoryId)
{
var categories = from c in source where c.ParenCategoryId == parentCategoryId select c;
return categories;
}
के रूप में पारित लेकिन निम्न कार्य अशक्त parentCategoryId
के स्थान पर सीधे इस्तेमाल किया है, तोpublic static IEnumerable<Category> GetChildren(this Table<Category> source, int? parentCategoryId)
{
var categories = from c in source where c.ParenCategoryId == null select c;
return categories;
}
जाँच की कोशिश करता है, तो (ParenCategoryID isEqualTo: शून्य) कर सकते हैं तो आप क्या चाहते हैं। – vishiphone