Asynchronous FromRawSql to call a stored procedure that returns a single record in EF Core 6

345 views Asked by At

I just found this way to call a stored procedure that returns a single record but I have to do it synchronously

enter image description here

If I try to do it asynchronously using FromRawSql().FirstOrDefault() I get this error:

"Employee" does not contain a definition for "GetAwaiter" or an accessible "GetAwaiter" extension method that accepts a first argument of type "Employee" (are you missing a using directive or an assembly reference?)

Any ideas, please?

Thanks

0

There are 0 answers