Answers for "The source 'IQueryable' doesn't implement 'IAsyncEnumerable<FlightSmart.Data.Models.OpenSkyFlight>'. Only sources that implement 'IAsyncEnumerable' can be used for Entity Framework asynchronous operations."

0

The source 'IQueryable' doesn't implement 'IAsyncEnumerable<FlightSmart.Data.Models.OpenSkyFlight>'. Only sources that implement 'IAsyncEnumerable' can be used for Entity Framework asynchronous operations.

public class SampleController
{
  public class PeopleType
  {
    public string Name { get; set; }
    public string Gender { get; set; }
  }

  public async Task<List<PeopleType>> GetAsyncPeopleList()
  {
    List<PeopleType> peopleList = new List<PeopleType>()
    {
      new PeopleType(){ Name = "Frank", Gender = "M" },
      new PeopleType(){ Name = "Rose", Gender = "F" },
      new PeopleType(){ Name = "Mark", Gender = "M" },
      new PeopleType(){ Name = "Andrew", Gender = "M" },
      new PeopleType(){ Name = "Sam", Gender = "M" },
      new PeopleType(){ Name = "Lisa", Gender = "F" },
      new PeopleType(){ Name = "Lucy", Gender = "F" }
    };

    var result = from e in peopleList
                 where e.Gender == "M"
                 select e;
    return await Task.FromResult(result.ToList());
  }
}
Posted by: Guest on March-15-2022

Code answers related to "The source 'IQueryable' doesn't implement 'IAsyncEnumerable<FlightSmart.Data.Models.OpenSkyFlight>'. Only sources that implement 'IAsyncEnumerable' can be used for Entity Framework asynchronous operations."

Browse Popular Code Answers by Language