Program.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. using Agile.Config.Client;
  2. using AspectCore.Extensions.DependencyInjection;
  3. using Microsoft.AspNetCore.Hosting;
  4. using Microsoft.Extensions.Configuration;
  5. using Microsoft.Extensions.Hosting;
  6. using Microsoft.Extensions.Logging;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Threading.Tasks;
  11. namespace XYY.Api.Customer
  12. {
  13. public class Program
  14. {
  15. public static void Main(string[] args)
  16. {
  17. CreateHostBuilder(args).Build().Run();
  18. }
  19. public static IHostBuilder CreateHostBuilder(string[] args) =>
  20. Host.CreateDefaultBuilder(args)
  21. .ConfigureAppConfiguration((context, config) =>
  22. {
  23. //ʹÓÃAddAgileConfigÅäÖÃÒ»¸öеÄIConfigurationSource
  24. config.AddAgileConfig();
  25. })
  26. .ConfigureWebHostDefaults(webBuilder =>
  27. {
  28. webBuilder.UseStartup<Startup>();
  29. }).UseServiceProviderFactory(x => new DynamicProxyServiceProviderFactory());
  30. }
  31. }