Ejemplo n.º 1
0
 static void InsertSingleItemEntityLite(int i)
 {
     using (var ds = new NorthwindDataService())
     {
         var item = new Entities.Item
         {
             Field1 = "Field 1." + i.ToString(),
             Field2 = "Field 2." + i.ToString(),
             Field3 = "Field 3." + i.ToString(),
             Field4 = "Field 4." + i.ToString()
         };
         ds.ItemRepository.Insert(item);
     }
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            //TestHttp();
            ConfigurationLite.DbProviderFactories.Register("System.Data.SQLite", Microsoft.Data.Sqlite.SqliteFactory.Instance);
            ////for (int i =0; i < 100; i++) TestQueue();
            profiler = new inercya.EntityLite.SqliteProfiler.Profiler(
                AppDomain.CurrentDomain.BaseDirectory,
                ProfileFileFrecuency.Daily,
                true
                );
            ConfigurationLite.Profiler = profiler;
            profiler.StartProfiling();
            using (ds = new NorthwindDataService())
            {
                ds.ApplicationContextGetter = () => "EntityLite.Tests";
                //TestEnums();
                //SingleTest(50000, InsertSingleItemEntityLite);
                //SequenceTest();
                //QueryByPrimaryKey();
                ShowSomeProducts();
                //ShowOrderDetails();
                ShowQuesoCabralesOrders();
                //ShowPagedProducts();
                //ShowLondonAndewFullerSubtree();
                //SearchOrderDetails();
                //ShowProductSales();
                //RaiseProductPrices();
                //InsertUpdateDeleteProduct();
                //RaiseProductPrices2();
                //HandCraftedSql();
                //Localization();
                //WillFail();
                //BuggyShowQuesoCabralesOrders();

                //Pivot();

                //ShowAllEmployeesThatSoldSpecifiedProducts();

                //JsonTest().Wait();
                //DbChangeNumberTest();
                //SynonymTest();
            }
            profiler.StopProfiling();
            //Console.WriteLine("Press enter to exit ...");
            //Console.ReadLine();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            //TestHttp();
            ConfigurationLite.DbProviderFactories.Register("System.Data.SQLite", System.Data.SQLite.SQLiteFactory.Instance);
            var loggerFactory = LoggerFactory.Create(builder =>
            {
                builder.SetMinimumLevel(LogLevel.Information)
                .AddFilter("inercya.EntityLite", LogLevel.Information)
                .AddFilter("inercya.EntityLite.SqliteProfiler", LogLevel.Trace)
                .AddFile($"SamplesCore-{DateTime.UtcNow.Ticks}.log", false);
            });


            ////for (int i =0; i < 100; i++) TestQueue();
            profiler = new inercya.EntityLite.SqliteProfiler.Profiler(
                AppDomain.CurrentDomain.BaseDirectory,
                ProfileFileFrecuency.Daily,
                true
                );
            ConfigurationLite.Profiler      = profiler;
            ConfigurationLite.LoggerFactory = loggerFactory;
            profiler.StartProfiling();
            using (ds = new NorthwindDataService())
            {
                //ds.ApplicationContextGetter = () => "EntityLite.Tests";
                //InsertIntoAsyncTest().Wait();
                //TestEnums();
                //SingleTest(50000, InsertSingleItemEntityLite);
                //SequenceTest();
                for (int i = 0; i < 100_000; i++)
                {
                    // Console.WriteLine(i);
                    QueryByPrimaryKey();
                }
                //ShowSomeProducts();
                //ShowOrderDetails();
                //ShowQuesoCabralesOrders();
                //ShowPagedProducts();
                //ShowLondonAndewFullerSubtree();
                //SearchOrderDetails();
                //ShowProductSales();
                //RaiseProductPrices();
                //InsertUpdateDeleteProduct();
                //RaiseProductPrices2();
                //HandCraftedSql();
                //Localization();
                //WillFail();
                //BuggyShowQuesoCabralesOrders();

                //Pivot();

                //ShowAllEmployeesThatSoldSpecifiedProducts();

                //JsonTest().Wait();
                //DbChangeNumberTest();
                //SynonymTest();
            }
            profiler.StopProfiling();
            Console.WriteLine("MaxQueueLength: {0}, DataServiceAttempts: {1}", profiler.MaxQueueLength, profiler.MaxDataServiceAttempts);
            //Console.WriteLine("Press enter to exit ...");
            //Console.ReadLine();

            loggerFactory.Dispose();
        }