Class NavigationService
Service for managing navigation within the application.
Implements
Inherited Members
Namespace: DataWeb.Structure
Assembly: DataWeb.Core.dll
Syntax
public sealed class NavigationService : INavigationService
Constructors
NavigationService(IStructureService, IAuthorizationService, IItemService, IStringLocalizer)
Service for managing navigation within the application.
Declaration
public NavigationService(IStructureService structureService, IAuthorizationService authorizationService, IItemService itemService, IStringLocalizer localizer)
Parameters
| Type | Name | Description |
|---|---|---|
| IStructureService | structureService | The structure service to use. |
| IAuthorizationService | authorizationService | The authorization service to use. |
| IItemService | itemService | The item service to use. |
| IStringLocalizer | localizer | The localizer to use for string resources. |
Methods
GetErrorMessage(string)
Gets the localized error message for the specified error code.
Declaration
public string GetErrorMessage(string errorCode)
Parameters
| Type | Name | Description |
|---|---|---|
| string | errorCode | The error code to get the message for. |
Returns
| Type | Description |
|---|---|
| string | The localized error message, or null if the error code is not recognized. |
GetNavigationContextAsync(Navigation, IUser, CancellationToken)
Gets the navigation context for the specified navigation and user.
Declaration
public Task<NavigationContext> GetNavigationContextAsync(Navigation navigation, IUser user, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Navigation | navigation | The Navigation to get the context for. |
| IUser | user | The IUser to get the context for. |
| CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task<NavigationContext> | A NavigationContext with IsNavigationValid set to true on success, or a context with ErrorCode populated if validation fails. |