0

Following the answer on this topic: https://stackoverflow.com/a/17748734/12518882

I've used the solution and it work perfect. The only things I don't understand is why i can use the Syncronous way and not the Asyncronous. I try to use await con.QueryAsync<> it give me an error: "Task<IEnumerable> doen't contain a definition for AsQueryable.

Someone can help me?

1 Answers1

1

await con.QueryAsync<> returns a Task which represents the asynchronous operation itself, not the result of the method you're calling. So you're attempting to call .AsQueryable() on type Task .

You can convert your awaited results like this:

var results = await connection.QueryAsync<A, B, A>(
        "your sql query",
         (a, b) =>
         {    
            //Perform operations

            return a;
         });          

 return results.AsQueryable();
optikd
  • 15
  • 6