Skip to main content
added 27 characters in body
Source Link
Magnus
  • 47.3k
  • 8
  • 88
  • 128

You can use object.Equals, it will match on null values also.

public static IEnumerable<Category> GetChildren(this Table<Category> source, int? parentCategoryId)
{
        var categories = from c in source 
                     where object.Equals(c.ParenCategoryId, parentCategoryId) select c;
                     select c;
    return categories;
} 

You can use object.Equals, it will match on null values also.

public static IEnumerable<Category> GetChildren(this Table<Category> source, int? parentCategoryId)
{
        var categories = from c in source 
             where object.Equals(c.ParenCategoryId, parentCategoryId) select c;
        return categories;
} 

You can use object.Equals, it will match on null values also.

public static IEnumerable<Category> GetChildren(this Table<Category> source, int? parentCategoryId)
{
    var categories = from c in source 
                     where object.Equals(c.ParenCategoryId, parentCategoryId) 
                     select c;
    return categories;
} 
Source Link
Magnus
  • 47.3k
  • 8
  • 88
  • 128

You can use object.Equals, it will match on null values also.

public static IEnumerable<Category> GetChildren(this Table<Category> source, int? parentCategoryId)
{
        var categories = from c in source 
             where object.Equals(c.ParenCategoryId, parentCategoryId) select c;
        return categories;
}