Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

IMenuService.cs

using Nop.Core;
using Nop.Core.Domain.Menus;

namespace Nop.Services.Menus;

/// 
/// Menu service interface
/// 
public partial interface IMenuService
{
    #region Menus

    /// 
    /// Deletes a menu
    /// 
    /// Menu
    /// A task that represents the asynchronous operation
    Task DeleteMenuAsync(Menu menu);

    /// 
    /// Gets all menus
    /// 
    /// 
    /// Menu type
    /// Store identifier; 0 if you want to get all records
    /// A value indicating whether to load hidden records
    /// Page index
    /// Page size
    /// A task that represents the asynchronous operation
    /// The task result contains the menus
    /// 
    Task> GetAllMenusAsync(
        MenuType? menuType = null,
        int storeId = 0,
        bool showHidden = false,
        int pageIndex = 0,
        int pageSize = int.MaxValue);

    /// 
    /// Gets a menu by identifier
    /// 
    /// The menu identifier
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains a menu
    /// 
    Task GetMenuByIdAsync(int menuId);

    /// 
    /// Insert a menu
    /// 
    /// Menu
    /// A task that represents the asynchronous operation
    Task InsertMenuAsync(Menu menu);

    /// 
    /// Update a menu
    /// 
    /// Menu
    /// A task that represents the asynchronous operation
    Task UpdateMenuAsync(Menu menu);

    #endregion

    #region Menu items

    /// 
    /// Deletes a menu item
    /// 
    /// Menu item
    /// A task that represents the asynchronous operation
    Task DeleteMenuItemAsync(MenuItem menuItem);

    /// 
    /// Ensure that menu items don't exceed a certain depth 
    /// 
    /// Menu items for filtering
    /// Parent menu item identifier
    /// Depth to limit items
    /// 
    /// Menu items limited in depth
    /// 
    IEnumerable FilterMenuItemsByDepth(IEnumerable menuItems, int parentId = 0, int depthLimit = 1);

    /// 
    /// Gets a menu item by identifier
    /// 
    /// Menu item identifier
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains a menu item
    /// 
    Task GetMenuItemByIdAsync(int menuItemId);

    /// 
    /// Insert a menu item
    /// 
    /// Menu item
    /// A task that represents the asynchronous operation
    Task InsertMenuItemAsync(MenuItem menuItem);

    /// 
    /// Update a menu item
    /// 
    /// Menu item
    /// A task that represents the asynchronous operation
    Task UpdateMenuItemAsync(MenuItem menuItem);

    /// 
    /// Get all menu items
    /// 
    /// Menu identifier; 0 or null to load all records
    /// Parent menu item identifier
    /// Store identifier; 0 if you want to get all records
    /// Depth to limit items
    /// A value indicating whether to sort menu items for tree representation
    /// A value indicating whether to show hidden records
    /// Page index
    /// Page size
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains menu items
    /// 
    Task> GetAllMenuItemsAsync(
        int menuId = 0,
        int parentMenuItemId = 0,
        int storeId = 0,
        int depth = 0,
        bool treeSorting = false,
        bool showHidden = false,
        int pageIndex = 0,
        int pageSize = int.MaxValue);

    #endregion
}