我正在我的控制器方法中尝试
public class SectionsTemplateController : Controller
{
// GET: SectionsTemplate
[HttpGet]
public async Task<List<EmptyPageTemplates>> GetEmptyPageTemplates()
{
var sectionsTemplatesStore = CosmosStoreFactory.CreateForEntity<EmptyPageTemplates>();
return await sectionsTemplatesStore.Query().Where(x=> x.Name != string.Empty).ToListAsync();
}
}
和我的poco:
public class EmptyPageTemplates
{
public int Id { get; set; }
public string Name { get; set; }
public List<Sections> Sections { get; set; }
}
public class Sections
{
public CanvasSectionType SectionType { get; set; }
public int Order { get; set; }
}
整个错误是:
Severity Code Description Project File Line Suppression State
Error CS1061 'IQueryable<EmptyPageTemplates>' does not contain a definition for 'ToListAsync' and no extension method 'ToListAsync' accepting a first argument of type 'IQueryable<EmptyPageTemplates>' could be found (are you missing a using directive or an assembly reference?) TenantManagementWebApi C:\Users\levm3\source\repos\TenantManagementWebApi\Controllers\SectionsTemplateController.cs 20 Active