本文整理汇总了C#中SqlQuery.SelectAll方法的典型用法代码示例。如果您正苦于以下问题:C# SqlQuery.SelectAll方法的具体用法?C# SqlQuery.SelectAll怎么用?C# SqlQuery.SelectAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SqlQuery
的用法示例。
在下文中一共展示了SqlQuery.SelectAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUp
public void SetUp()
{
var da = new SqlQuery();
foreach (Person p in da.SelectAll(typeof(Person)))
if (p.ID > 10 || p.FirstName == "Crazy")
da.DeleteByKey(typeof(Person), p.ID);
}
示例2: FindAll
public List<Doctor> FindAll()
{
using (var db = new DbManager())
{
var query = new SqlQuery<Doctor>(db);
return query.SelectAll();
}
}
示例3: TestDataTypeTestInsert
public void TestDataTypeTestInsert()
{
using (DbManager db = new DbManager())
{
var dt = new DataTypeTest2
{
Binary_ = new byte[2] { 1, 2 },
#if !ORACLE
Boolean_ = true,
Guid_ = Guid.Empty,
#endif
Byte_ = 250,
Bytes_ = new byte[] { 2, 1 },
DateTime_ = DateTime.Now,
Decimal_ = 9876543210.0m,
Double_ = 12345.67890,
Int16_ = 12345,
Int32_ = 1234567890,
Int64_ = 1234567890123456789,
Money_ = 99876543210.0m,
Single_ = 1234.0f,
String_ = "Crazy Frog",
Char_ = 'F',
SByte_ = 123,
UInt16_ = UInt16.MaxValue,
UInt32_ = UInt32.MaxValue,
UInt64_ = UInt64.MaxValue,
#if !SQLCE
Stream_ = new MemoryStream(5),
Xml_ = new XmlTextReader(new StringReader("<xml/>")),
XmlDoc_ = new XmlDocument()
#endif
};
#if !SQLCE
dt.XmlDoc_.LoadXml("<root><sql id=\"1\">Some Text</sql></root>");
#endif
SqlQuery query = new SqlQuery(db);
query.Insert(dt);
var list = query.SelectAll<DataTypeTest2>();
Assert.That(list.Any(_ => _.UInt16_ == UInt16.MaxValue && _.UInt32_ == UInt32.MaxValue && _.UInt64_ == UInt64.MaxValue));
}
}