Пример #1
0
        public void Bug_CSHARP_42()
        {
            Table<SalesOrder> table = Session.GetTable<SalesOrder>();
            table.CreateIfNotExists();

            Batch batch = Session.CreateBatch();

            var order = new SalesOrder
            {
                OrderNumber = "OR00012345",
                Customer = "Jeremiah Peschka",
                SalesPerson = "The Internet",
                OrderDate = DateTime.Now,
                ShipDate = DateTime.Now.AddDays(2)
            };

            batch.Append(table.Insert(order));
            batch.Execute();

            List<SalesOrder> lst = (from x in table select x).Execute().ToList();

            Trace.TraceInformation("done!");
        }
Пример #2
0
        //https://datastax-oss.atlassian.net/browse/CSHARP-42
        //Create table causes InvalidOperationException
        public void Bug_CSHARP_42()
        {
            Table <SalesOrder> table = Session.GetTable <SalesOrder>();

            table.CreateIfNotExists();

            Batch batch = Session.CreateBatch();

            var order = new SalesOrder
            {
                OrderNumber = "OR00012345",
                Customer    = "Jeremiah Peschka",
                SalesPerson = "The Internet",
                OrderDate   = DateTime.Now,
                ShipDate    = DateTime.Now.AddDays(2)
            };

            batch.Append(table.Insert(order));
            batch.Execute();

            List <SalesOrder> lst = (from x in table select x).Execute().ToList();

            Trace.TraceInformation("done!");
        }