using CoreDatabase; using DepartmentContract.Logics.IGenericEntityLogic; using System; using System.Threading.Tasks; using ToolsModule.ManagmentDependency; using ToolsModule.ManagmentSecurity; namespace WindowServiceSyncStudentOrders { class Program { static void Main(string[] args) { Console.WriteLine("Start sync student orders"); try { DependencyManager.Instance.RegisterType(); DependencyManager.InitDependency(); var logic = DependencyManager.Instance.Resolve(); var task = Task.Run(() => logic.SyncOrders()); Task.WaitAll(new Task[] { task }); if (task.Result) { Console.WriteLine("Student orders sync success"); } else { Console.WriteLine("Student orders sync fail"); } } catch(Exception ex) { Console.WriteLine(ex.Message); } } } }