本文整理汇总了C#中ProductModel.Count方法的典型用法代码示例。如果您正苦于以下问题:C# ProductModel.Count方法的具体用法?C# ProductModel.Count怎么用?C# ProductModel.Count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProductModel
的用法示例。
在下文中一共展示了ProductModel.Count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SPTest
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: QueryTest
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: ManyToManyUpdateTest
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);
}
}