Class MenuDisplayItemModelExtensions
- Namespace
- Songhay.Extensions
- Assembly
- SonghayCore.dll
Extensions of MenuDisplayItemModel
public static class MenuDisplayItemModelExtensions
- Inheritance
-
MenuDisplayItemModelExtensions
- Inherited Members
Methods
DefaultOrFirst(IEnumerable<MenuDisplayItemModel>?)
Returns the Default Selection
IsDefaultSelection == true
or the First MenuDisplayItemModel.
public static MenuDisplayItemModel? DefaultOrFirst(this IEnumerable<MenuDisplayItemModel>? data)
Parameters
data
IEnumerable<MenuDisplayItemModel>The data.
Returns
GetAllBy(MenuDisplayItemModel?, Func<MenuDisplayItemModel, bool>)
Gets all MenuDisplayItemModel by the specified predicate.
public static IEnumerable<MenuDisplayItemModel> GetAllBy(this MenuDisplayItemModel? data, Func<MenuDisplayItemModel, bool> predicate)
Parameters
data
MenuDisplayItemModelpredicate
Func<MenuDisplayItemModel, bool>the predicate
Returns
HasGroupId(MenuDisplayItemModel?, string)
Returns true
when the grouping has the specified identifier.
public static bool HasGroupId(this MenuDisplayItemModel? data, string groupId)
Parameters
data
MenuDisplayItemModelgroupId
stringthe GroupId
Returns
WithChildItem(MenuDisplayItemModel?, MenuDisplayItemModel?)
Fluently returns MenuDisplayItemModel with child item.
public static MenuDisplayItemModel? WithChildItem(this MenuDisplayItemModel? data, MenuDisplayItemModel? child)
Parameters
data
MenuDisplayItemModelThe data.
child
MenuDisplayItemModelThe child.
Returns
WithChildItems(MenuDisplayItemModel?, IEnumerable<MenuDisplayItemModel>?)
Fluently returns MenuDisplayItemModel with child items.
public static MenuDisplayItemModel? WithChildItems(this MenuDisplayItemModel? data, IEnumerable<MenuDisplayItemModel>? items)
Parameters
data
MenuDisplayItemModelThe data.
items
IEnumerable<MenuDisplayItemModel>The items.