Example #1
0
        static void Main(string[] args)
        {
            ConfigureServices();
            using (var scope = ApplicationServices.CreateScope())
            {
                string strEnter = "";

                var service = scope.ServiceProvider.GetService <IMyProductService>();
                service.AddLogging();
                service.createDatabase();
                //service.addData();
                //service.ShowAllEntries();

                //service.UpdateData();
                Console.ReadLine();
                Console.WriteLine("Old DS:");
                service.FilterEntries();

                while (strEnter.ToLower() != "x")
                {
                    service.UpdateData(strEnter);
                    Console.WriteLine("Updated DS:");
                    service.FilterEntries();
                    strEnter = Console.ReadLine();
                }
                //service.dropDatabase();
            }
        }
Example #2
0
 static void Main(string[] args)
 {
     ConfigureServices();
     using (var scope = ApplicationServices.CreateScope())
     {
         var service = scope.ServiceProvider.GetService <RunService>();
         service.AddLogging();
         service.CreateDatabase();
         service.CreateRecords();
         service.Query();
     }
 }
Example #3
0
 public IServiceScope CreateScope()
 {
     return(ApplicationServices.CreateScope());
 }