Spaces:
Running
Running
User commited on
Commit ·
5419b6f
1
Parent(s): 4c550c2
add: MenuEntity Namespace
Browse files
TaskTrackingSystem.WebApi/Features/Menu/MenuService.cs
CHANGED
|
@@ -5,6 +5,7 @@ using System.Linq;
|
|
| 5 |
using System.Threading.Tasks;
|
| 6 |
using TaskTrackingSystem.Database.AppDbContextModels;
|
| 7 |
using TaskTrackingSystem.Shared.Models.Menu;
|
|
|
|
| 8 |
|
| 9 |
namespace TaskTrackingSystem.WebApi.Features.Menu
|
| 10 |
{
|
|
@@ -82,7 +83,7 @@ namespace TaskTrackingSystem.WebApi.Features.Menu
|
|
| 82 |
return BuildHierarchy(filteredMenus);
|
| 83 |
}
|
| 84 |
|
| 85 |
-
private static List<MenuDto> BuildHierarchy(List<
|
| 86 |
{
|
| 87 |
if (menus.Count == 0)
|
| 88 |
{
|
|
@@ -127,7 +128,7 @@ namespace TaskTrackingSystem.WebApi.Features.Menu
|
|
| 127 |
return roots;
|
| 128 |
}
|
| 129 |
|
| 130 |
-
private static string GetParentCode(
|
| 131 |
{
|
| 132 |
if (!menu.ParentMenuId.HasValue)
|
| 133 |
{
|
|
@@ -139,7 +140,7 @@ namespace TaskTrackingSystem.WebApi.Features.Menu
|
|
| 139 |
: string.Empty;
|
| 140 |
}
|
| 141 |
|
| 142 |
-
private static HashSet<long> ExpandWithAncestors(IEnumerable<long> menuIds, IReadOnlyDictionary<long,
|
| 143 |
{
|
| 144 |
var expanded = new HashSet<long>();
|
| 145 |
|
|
|
|
| 5 |
using System.Threading.Tasks;
|
| 6 |
using TaskTrackingSystem.Database.AppDbContextModels;
|
| 7 |
using TaskTrackingSystem.Shared.Models.Menu;
|
| 8 |
+
using MenuEntity = TaskTrackingSystem.Database.AppDbContextModels.Menu;
|
| 9 |
|
| 10 |
namespace TaskTrackingSystem.WebApi.Features.Menu
|
| 11 |
{
|
|
|
|
| 83 |
return BuildHierarchy(filteredMenus);
|
| 84 |
}
|
| 85 |
|
| 86 |
+
private static List<MenuDto> BuildHierarchy(List<MenuEntity> menus)
|
| 87 |
{
|
| 88 |
if (menus.Count == 0)
|
| 89 |
{
|
|
|
|
| 128 |
return roots;
|
| 129 |
}
|
| 130 |
|
| 131 |
+
private static string GetParentCode(MenuEntity menu, IReadOnlyDictionary<long, MenuEntity> menuLookup)
|
| 132 |
{
|
| 133 |
if (!menu.ParentMenuId.HasValue)
|
| 134 |
{
|
|
|
|
| 140 |
: string.Empty;
|
| 141 |
}
|
| 142 |
|
| 143 |
+
private static HashSet<long> ExpandWithAncestors(IEnumerable<long> menuIds, IReadOnlyDictionary<long, MenuEntity> menuLookup)
|
| 144 |
{
|
| 145 |
var expanded = new HashSet<long>();
|
| 146 |
|