Beispiel #1
0
        static async Task SelectIntoAsyncTest()
        {
            ds.BeginTransaction();
            var tableName = "##OrderDetails" + Guid.NewGuid().ToString("N");

            var createdRowCount = ds.OrderDetailRepository.Query(Projection.BaseTable)
                                  .Where(nameof(OrderDetail.ProductId), OperatorLite.Equals, 9)
                                  .SelectIntoAsync(tableName);

            var q2 = new TableOrViewQueryLite <OrderDetail>(tableName, ds);
            var orderDetailsInTempTable = await q2.ToListAsync();

            ds.Commit();
        }
Beispiel #2
0
        //static void ShowAllEmployeesThatSoldSpecifiedProducts()
        //{

        //    var query = ds.EmployeeRepository.ThatSoldAllSpecifiedProductsQuery(Enumerable.Range(1, 6))
        //        .Fields(EmployeeFields.EmployeeId, EmployeeFields.FirstName, EmployeeFields.LastName)
        //        .OrderBy(EmployeeFields.FirstName, EmployeeFields.LastName);



        //    var any = query.Any();

        //    foreach (var e in query.ToEnumerable())
        //    {
        //        Console.WriteLine("{0}: {1} {2}", e.EmployeeId, e.FirstName, e.LastName);
        //    }
        //}

        static void InsertMultipleItems(int itemCount)
        {
            ds.BeginTransaction();
            for (int i = 1; i < itemCount; i++)
            {
                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);
            }
            ds.Commit();
        }