LocalApiServiceExtensions.cs 825 B

1234567891011121314151617181920212223242526272829303132
  1. 
  2. using Sers.Core.Module.Api.LocalApi;
  3. using System.Reflection;
  4. using Sers.SersLoader;
  5. using ApiLoader = Sers.NetcoreLoader.ApiLoader;
  6. namespace Vit.Extensions
  7. {
  8. public static partial class LocalApiServiceExtensions
  9. {
  10. /// <summary>
  11. /// 调用netcore加载器加载api
  12. /// </summary>
  13. /// <param name="localApiService"></param>
  14. /// <param name="assembly"></param>
  15. public static void LoadNetcoreApi(this LocalApiService localApiService, Assembly assembly)
  16. {
  17. if (null == localApiService)
  18. {
  19. return;
  20. }
  21. var config = new ApiLoaderConfig { assembly= assembly };
  22. localApiService.apiNodeMng.AddApiNode(new ApiLoader().LoadApi(config));
  23. }
  24. }
  25. }