From 0ce70c17134dc001ddfde61047908b1d4c7ad5ac Mon Sep 17 00:00:00 2001 From: mohammad_hoseinzadehashraf_geeksltd Date: Wed, 19 Jun 2024 11:44:56 +0100 Subject: [PATCH] refactor navigation class to search within domain and website assemblies only --- Olive.Mvc.Microservices/NavigationApiMiddleWare.cs | 8 ++++++-- Olive.Mvc.Microservices/Olive.Mvc.Microservices.csproj | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Olive.Mvc.Microservices/NavigationApiMiddleWare.cs b/Olive.Mvc.Microservices/NavigationApiMiddleWare.cs index 0f05e080..6e4a923a 100644 --- a/Olive.Mvc.Microservices/NavigationApiMiddleWare.cs +++ b/Olive.Mvc.Microservices/NavigationApiMiddleWare.cs @@ -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); } @@ -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(); } } \ No newline at end of file diff --git a/Olive.Mvc.Microservices/Olive.Mvc.Microservices.csproj b/Olive.Mvc.Microservices/Olive.Mvc.Microservices.csproj index 78bbab08..b00e1140 100644 --- a/Olive.Mvc.Microservices/Olive.Mvc.Microservices.csproj +++ b/Olive.Mvc.Microservices/Olive.Mvc.Microservices.csproj @@ -1,7 +1,7 @@  netcoreapp3.1 - 3.1.155 + 3.1.156