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

            dynamic customer = new ExpandoObject();

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

            var id = service.Insert(customer);

            customer = service.Get(id);

            ObjectDumper.Write(customer);

            customer.Country = "United Kingdom";

            service.Update(customer);

            customer = service.Get(id);

            ObjectDumper.Write(customer);

            service.Delete(customer);

            customer = service.Get(id);

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

            dynamic customer = new ExpandoObject();

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

            var id = service.Insert(customer);

            customer = service.Get(id);

            ObjectDumper.Write(customer);

            customer.Country = "United Kingdom";

            service.Update(customer);

            customer = service.Get(id);

            ObjectDumper.Write(customer);

            service.Delete(customer);

            customer = service.Get(id);

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

            var customers = service.GetCustomers();

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

            var sales = service.GetSalesSummary(2011);

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

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

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

            var sales = service.GetSalesSummary(2011);

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

            var customers = service.GetCustomers();

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

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

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

            var result = service.GetCustomers(2);

            foreach (var 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 PagedQuery()
        {
            var service = new MassiveServices();

            var result = service.GetCustomers(2);

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

            ObjectDumper.Write(string.Format("There are {0} records matching the criteria", result.TotalRecords));
        }