'IQueryable <emptypagetemplates>'不包含'ToListAsync'的定义,也没有扩展方法

时间:2019-01-18 23:22:11

标签: .net asp.net-web-api

我正在我的控制器方法中尝试

 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

0 个答案:

没有答案
相关问题