【发布时间】:2019-11-16 02:31:21
【问题描述】:
我想对 Azure 表存储执行查询语句。 在我写的代码下面:
public List<T> RetrieveEntity<T>(string Query = null) where T : TableEntity, new()
{
try
{
// Create the Table Query Object for Azure Table Storage
TableQuery<T> DataTableQuery = new TableQuery<T>();
if (!String.IsNullOrEmpty(Query))
{
DataTableQuery = new TableQuery<T>().Where(Query);
}
IEnumerable<T> IDataList = table.ExecuteQuery(DataTableQuery);
List<T> DataList = new List<T>();
foreach (var singleData in IDataList)
DataList.Add(singleData);
return DataList;
}
catch (Exception ExceptionObj)
{
throw ExceptionObj;
}
}
我如何输入下一行?
IEnumerable IDataList = table.ExecuteQuery(DataTableQuery);
为了让一切正常工作?
谢谢, 西蒙娜
【问题讨论】: