-
Notifications
You must be signed in to change notification settings - Fork 1
/
MenuViewComponent.cs
45 lines (41 loc) · 2.22 KB
/
MenuViewComponent.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*==============================================================================================================================
| Author Ignia, LLC
| Client GoldSim
| Project Website
\=============================================================================================================================*/
using OnTopic.AspNetCore.Mvc.Components;
using OnTopic.AspNetCore.Mvc.Models;
using OnTopic.Mapping.Hierarchical;
namespace GoldSim.Web.Components {
/*============================================================================================================================
| CLASS: MENU VIEW COMPONENT
\---------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Defines a <see cref="ViewComponent"/> which provides access to a menu of <typeparamref name="NavigationTopicViewModel"/>
/// instances.
/// </summary>
/// <remarks>
/// <para>
/// As a best practice, global data required by the layout view are requested independent of the current page. This
/// allows each layout element to be provided with its own layout data, in the form of <see
/// cref="NavigationViewModel{T}"/>s, instead of needing to add this data to every view model returned by <see
/// cref="TopicController"/>.
/// </para>
/// </remarks>
public class MenuViewComponent : MenuViewComponentBase<Models.NavigationTopicViewModel> {
/*==========================================================================================================================
| CONSTRUCTOR
\-------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Initializes a new instance of a <see cref="MenuViewComponentBase{T}"/> with necessary dependencies.
/// </summary>
/// <returns>A topic controller for loading OnTopic views.</returns>
public MenuViewComponent(
ITopicRepository topicRepository,
IHierarchicalTopicMappingService<Models.NavigationTopicViewModel> hierarchicalTopicMappingService
) : base(
topicRepository,
hierarchicalTopicMappingService
) {}
} // Class
} // Namespace