Base solution for your next web application
Open Closed

How to convert from DbDataReader to Task<IEnumerable<T>? #4613


User avatar
0
manojreddy created

Hi, I'm facing problem in getting entity data from DB using Stored Procedure.

I have posted the same question on SO also but didn't get the proper answer, please help.

[https://stackoverflow.com/questions/48565680/how-to-convert-from-dbdatareader-to-taskienumerabletentity-in-entity-framewo])


2 Answer(s)
  • User Avatar
    0
    strix20 created

    I don't think you can do what you're attempting to do.

    The only way I know to get results similar to what you want, is to use .FromSql, like the last SO answer suggests.

  • User Avatar
    0
    alirizaadiyahsi created

    Hi @ManojReddy,

    check these (custom repository): <a class="postlink" href="https://www.codeproject.com/Articles/1199648/Using-Stored-Procedure-User-Defined-Function-and-V">https://www.codeproject.com/Articles/11 ... tion-and-V</a> <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/EntityFramework-Integration#custom-repository-example">https://aspnetboilerplate.com/Pages/Doc ... ry-example</a>