コード例 #1
0
ファイル: Query.aspx.cs プロジェクト: hasi/EasyData
        protected void SPTest()
        {
            using (EasySession easySession = new EasySession())
            {
                ProductModel productModel = new ProductModel();
                int resultCount = productModel.Count(easySession);
                Assert.AreEqual(129, resultCount);

                ObjectQuery testOQ = new ObjectQuery();
                //testOQ.DeleteSP("uspDeleteProductModels", easySession).SetParameterList("list", new int[] { 1, 2, 3 }, typeof(int)).Execute();

                resultCount = productModel.Count(easySession);
                Assert.AreEqual(126, resultCount);
            }
        }
コード例 #2
0
ファイル: Query.aspx.cs プロジェクト: hasi/EasyData
        protected void QueryTest()
        {
            using (EasySession easySession = new EasySession())
            {
                ProductModel productModel = new ProductModel();
                int resultCount = productModel.Count(easySession);
                Assert.AreEqual(129, resultCount);

                ObjectQuery testOQ = new ObjectQuery();
                //testOQ.EasyQuery(easySession).From(productModel.GetType()).Where().
                //var result = testOQ.DeleteQuery("DELETE FROM Production.ProductModel WHERE ProductModelID IN (:list)", easySession).SetParameterList("list", new int[] { 1, 2, 3 }, typeof(int)).Execute();

                resultCount = productModel.Count(easySession);
                Assert.AreEqual(126, resultCount);
            }
        }
コード例 #3
0
ファイル: Update.aspx.cs プロジェクト: hasi/EasyData
        public void ManyToManyUpdateTest()
        {
            using (EasySession easySession = new EasySession())
            {
                ///[Test Update] - many-to-many relationship
                ProductModelIllustration productModelIllustration = new ProductModelIllustration();
                int resultCount = productModelIllustration.Count(easySession);
                Assert.AreEqual(5, resultCount);

                ProductModel productModel = new ProductModel();
                resultCount = productModel.Count(easySession);
                Assert.AreEqual(129, resultCount);

                productModel.ProductModelID = 47;
                ProductModel resultList = productModel.Find(easySession, EasyLoad.Simple);

                //resultList.Illustration.RemoveAt(0);
                bool result = resultList.Update(easySession);

                resultCount = resultList.Count(easySession);
                Assert.AreEqual(129, resultCount);

                resultCount = productModelIllustration.Count(easySession);
                Assert.AreEqual(5, resultCount);
            }
        }