本文整理匯總了C#中Westwind.Utilities.Data.SqlDataAccess.Find方法的典型用法代碼示例。如果您正苦於以下問題:C# SqlDataAccess.Find方法的具體用法?C# SqlDataAccess.Find怎麽用?C# SqlDataAccess.Find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Westwind.Utilities.Data.SqlDataAccess
的用法示例。
在下文中一共展示了SqlDataAccess.Find方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: FindBySqlTest
public void FindBySqlTest()
{
using (var data = new SqlDataAccess(STR_ConnectionString))
{
var entry = data.Find<WebLogEntry>("select * from ApplicationLog where [email protected]", 1);
Assert.IsNotNull(entry, data.ErrorMessage);
Console.WriteLine(entry.Entered + " " + entry.Message);
}
}
示例2: FindTest
public void FindTest()
{
using (var data = new SqlDataAccess(STR_ConnectionString))
{
var customer = data.Find<Customer>("select * from customers where [email protected]", 1);
Assert.IsNotNull(customer, data.ErrorMessage);
Console.WriteLine(customer.Company);
}
}
示例3: FindByIdTest
public void FindByIdTest()
{
using (var data = new SqlDataAccess(STR_ConnectionString))
{
var entry = data.Find<WebLogEntry>(1, "ApplicationLog", "Id");
Assert.IsNotNull(entry, data.ErrorMessage);
Console.WriteLine(entry.Entered + " " + entry.Message);
var entry2 = new WebLogEntry();
data.GetEntity(entry2, "ApplicationLog", "Id", 1);
Assert.IsNotNull(entry2);
Assert.AreEqual(entry2.Message, entry.Message);
Console.WriteLine(entry2.Entered + " " + entry2.Message);
}
}