public static List <AuthorizationBo> GetAuthorization() { try { IStarterService startService = new StarterService(new UnitOfWork()); return(startService.Authorization()); } catch { throw; } }
public static void Start(StarterService service) { if (Environment.UserInteractive) { Console.CancelKeyPress += (o, e) => service.Stop(); service.Start(); Console.WriteLine(@"Running service, press a key to stop"); Console.ReadKey(); service.Stop(); Console.WriteLine(@"Service stopped. Goodbye."); return; } ServiceBase.Run(new ServiceBase[] { service }); }