本文整理汇总了C#中IQuery.List方法的典型用法代码示例。如果您正苦于以下问题:C# IQuery.List方法的具体用法?C# IQuery.List怎么用?C# IQuery.List使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IQuery
的用法示例。
在下文中一共展示了IQuery.List方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAreas
private static IList<Area> GetAreas(IQuery q)
{
var list = q.List();
return (from object[] row in list select GetAreaFromRow(row)).ToList();
}
示例2: ExecuteQuery
/// <summary>
/// Override to provide a custom query execution.
/// The default behaviour is to just call <see cref="IQuery.List()"/>.
/// </summary>
/// <param name="query">The query</param>
/// <returns>The query results.</returns>
protected virtual IEnumerable ExecuteQuery(IQuery query)
{
return query.List();
}
示例3: GetDataSource
private IList GetDataSource(IQuery query)
{
if (query == null)
throw new ArgumentNullException("query", "The query object to execute cannot be null.");
IList lista = query.List();
if (lista == null || lista.Count == 0)
return null;
this.Reset();
return lista;
}
示例4: GetComputersByOwner
public Computer[] GetComputersByOwner(string Owner)
{
Computer[] computers = null;
IList list = null;
try
{
session = sessionFactory.OpenSession();
qry = session.CreateQuery("from Computer where Owner='"+Owner+"'");
list = qry.List();
computers = new Computer[list.Count];
list.CopyTo(computers, 0);
}
finally
{
session.Flush();
session.Disconnect();
}
return computers;
}