Ejemplo n.º 1
0
        public void StoredProcedure_builder_using_expression()
        {
            var product = Context.Sql("select * from Product where ProductId = 1")
                          .QuerySingle <Product>();

            product.Name = "The Warren Buffet Way";

            var mysqlProduct = new MySqlProduct(product);
            var rowsAffected = Context.StoredProcedure <MySqlProduct>("ProductUpdate", mysqlProduct)
                               .Parameter(x => x.ParamProductId)
                               .Parameter(x => x.ParamName).Execute();

            Assert.AreEqual(1, rowsAffected);
        }
Ejemplo n.º 2
0
        public void StoredProcedure_builder_automapping()
        {
            var product = Context.Sql("select * from Product where ProductId = 1")
                          .QuerySingle <Product>();

            product.Name = "The Warren Buffet Way";

            var mysqlProduct = new MySqlProduct(product);

            var rowsAffected = Context.StoredProcedure <MySqlProduct>("ProductUpdate", mysqlProduct)
                               .AutoMap(x => x.ParamCategoryId).Execute();

            Assert.AreEqual(1, rowsAffected);
        }