示例#1
0
文件: Program.cs 项目: ciker/MicroORM
        private static void Crud()
        {
            var service = new SimpleDataDynamicServices();

            dynamic customer = new ExpandoObject();

            customer.FirstName = "Ian";
            customer.LastName  = "Russell";
            customer.Email     = "*****@*****.**";

            customer = service.Insert(customer);

            ObjectDumper.Write(customer);

            customer.Country = "United Kingdom";

            service.Update(customer);

            customer = service.Get(customer.CustomerId);

            ObjectDumper.Write(customer);

            service.Delete(customer);

            customer = service.Get(customer.CustomerId);

            ObjectDumper.Write(customer);
        }
示例#2
0
文件: Program.cs 项目: ciker/MicroORM
        private static void Crud()
        {
            var service = new SimpleDataDynamicServices();

            dynamic customer = new ExpandoObject();

            customer.FirstName = "Ian";
            customer.LastName = "Russell";
            customer.Email = "*****@*****.**";

            customer = service.Insert(customer);

            ObjectDumper.Write(customer);

            customer.Country = "United Kingdom";

            service.Update(customer);

            customer = service.Get(customer.CustomerId);

            ObjectDumper.Write(customer);

            service.Delete(customer);

            customer = service.Get(customer.CustomerId);

            ObjectDumper.Write(customer);
        }
示例#3
0
文件: Program.cs 项目: ciker/MicroORM
        private static void SelectProcedure()
        {
            var service = new SimpleDataDynamicServices();

            var sales = service.GetSalesSummary(2011);

            foreach (var item in sales)
                ObjectDumper.Write(item);
        }
示例#4
0
文件: Program.cs 项目: ciker/MicroORM
        private static void FilteredQuery()
        {
            var service = new SimpleDataDynamicServices();

            var customers = service.GetCustomersFromCountry("United Kingdom");

            foreach (var customer in customers)
                ObjectDumper.Write(customer);
        }
示例#5
0
文件: Program.cs 项目: ciker/MicroORM
        private static void SelectProcedure()
        {
            var service = new SimpleDataDynamicServices();

            var sales = service.GetSalesSummary(2011);

            foreach (var item in sales)
            {
                ObjectDumper.Write(item);
            }
        }
示例#6
0
文件: Program.cs 项目: ciker/MicroORM
        private static void SimpleQuery()
        {
            var service = new SimpleDataDynamicServices();

            var customers = service.GetCustomers();

            foreach (var customer in customers)
            {
                ObjectDumper.Write(customer);
            }
        }
示例#7
0
文件: Program.cs 项目: ciker/MicroORM
        private static void FilteredQuery()
        {
            var service = new SimpleDataDynamicServices();

            var customers = service.GetCustomersFromCountry("United Kingdom");

            foreach (var customer in customers)
            {
                ObjectDumper.Write(customer);
            }
        }
示例#8
0
文件: Program.cs 项目: ciker/MicroORM
        private static void PagedQuery()
        {
            var service = new SimpleDataDynamicServices();

            var result = service.GetCustomers(2);

            foreach (dynamic customer in result.Items)
                ObjectDumper.Write(customer);

            ObjectDumper.Write(string.Format("There are {0} records matching the criteria", result.TotalRecords));
        }
示例#9
0
文件: Program.cs 项目: ciker/MicroORM
        private static void PagedQuery()
        {
            var service = new SimpleDataDynamicServices();

            var result = service.GetCustomers(2);

            foreach (dynamic customer in result.Items)
            {
                ObjectDumper.Write(customer);
            }

            ObjectDumper.Write(string.Format("There are {0} records matching the criteria", result.TotalRecords));
        }
示例#10
0
文件: Program.cs 项目: ciker/MicroORM
        private static void SimpleQuery()
        {
            var service = new SimpleDataDynamicServices();

            var customers = service.GetCustomers();

            foreach (var customer in customers)
                ObjectDumper.Write(customer);
        }