Program.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using Abp;
  3. using Abp.Castle.Logging.Log4Net;
  4. using Abp.Collections.Extensions;
  5. using Abp.Dependency;
  6. using Castle.Facilities.Logging;
  7. namespace WePlatform
  8. {
  9. public class Program
  10. {
  11. private static bool _skipConnVerification = true;
  12. public static void Main(string[] args)
  13. {
  14. ParseArgs(args);
  15. using (var bootstrapper = AbpBootstrapper.Create<WePlatformMigratorModule>())
  16. {
  17. bootstrapper.IocManager.IocContainer
  18. .AddFacility<LoggingFacility>(f => f.UseAbpLog4Net()
  19. .WithConfig("log4net.config")
  20. );
  21. bootstrapper.Initialize();
  22. using (var migrateExecuter = bootstrapper.IocManager.ResolveAsDisposable<MultiTenantMigrateExecuter>())
  23. {
  24. migrateExecuter.Object.Run(_skipConnVerification);
  25. }
  26. Console.WriteLine("Press ENTER to exit...");
  27. Console.ReadLine();
  28. }
  29. }
  30. private static void ParseArgs(string[] args)
  31. {
  32. if (args.IsNullOrEmpty())
  33. {
  34. return;
  35. }
  36. for (int i = 0; i < args.Length; i++)
  37. {
  38. var arg = args[i];
  39. switch (arg)
  40. {
  41. case "-s":
  42. _skipConnVerification = true;
  43. break;
  44. }
  45. }
  46. }
  47. }
  48. }