Skip to content

Commit

Permalink
refactor navigation class to search within domain and website assembl…
Browse files Browse the repository at this point in the history
…ies only
  • Loading branch information
hoseinzadehashraf committed Jun 19, 2024
1 parent 6957fc0 commit 0ce70c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Olive.Mvc.Microservices/NavigationApiMiddleWare.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ internal static async Task Search(HttpContext context)
Infos = navigations.SelectMany(x => x.GetBoardInfos()),
Menus = navigations.SelectMany(x => x.GetBoardMenus()),
Intros = navigations.SelectMany(x => x.GetBoardIntros()),
BoxOrder= navigations.Select(x=>x.GetBoardOrder())
BoxOrder = navigations.Select(x => x.GetBoardOrder())
});
await context.Response.WriteAsync(response);
}
Expand All @@ -87,6 +87,10 @@ internal static async Task BoardSources(HttpContext context)
var result = Newtonsoft.Json.JsonConvert.SerializeObject(boardSources);
await context.Response.WriteAsync(result);
}
static Type[] AllLoadedTypes() => AppDomain.CurrentDomain.GetAssemblies().SelectMany(x => x.GetTypes()).ToArray();
static Type[] AllLoadedTypes() => AppDomain.CurrentDomain
.GetAssemblies()
.Where(x => new string[] { "domain", "website" }.Contains(x.GetName().Name.ToLower()))
.SelectMany(x => x.GetTypes())
.ToArray();
}
}
2 changes: 1 addition & 1 deletion Olive.Mvc.Microservices/Olive.Mvc.Microservices.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>3.1.155</Version>
<Version>3.1.156</Version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 0ce70c1

Please sign in to comment.