Program.cs 789 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using Sers.Core.Extensions;
  2. using Sers.Core.Util.Ioc;
  3. using Sers.ServiceStation;
  4. using static App.Ioc.Station.Controllers.Demo.DemoController;
  5. namespace Main
  6. {
  7. public class Program
  8. {
  9. public static void Main(string[] args)
  10. {
  11. ServiceStation.Init();
  12. #region ioc
  13. //use ioc
  14. Sers.Core.Module.Rpc.RpcFactory.Instance.UseIoc();
  15. IocHelp.AddSingleton<ISingleton, ArgModel>();
  16. IocHelp.AddScoped<IScoped, ArgModel>();
  17. IocHelp.AddTransient<ITransient, ArgModel>();
  18. IocHelp.Update();
  19. #endregion
  20. ServiceStation.Discovery(typeof(Program).Assembly);
  21. ServiceStation.Start();
  22. ServiceStation.RunAwait();
  23. }
  24. }
  25. }