'IQueryable<EmptyPageTemplates>' does not contain a definition for 'ToListAsync' and no extension method

655 views Asked by At

I am trying this in my controller method

 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();

        }
    }

and my 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; }
    }

The entire error is:

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

There are 0 answers