I would like to use a stored procedure to retrieve entities from a DB, I don’t care about tracking changes. I just need all entities be resolved including related ones.
-
Do I have to use SqlCommand?
-
What about complex properties, will they be resolved too?
-
Any other limitations you could tell me about?
Thanks!
General answer about using stored procedures in EF is here so stored procedure in pure EF will not handle navigation properties. The answer also mentioned EFExtensions but that is not available in DbContext API.
To execute stored procedure in DbContext API use:
DbContext API doesn’t offer any function import like EDMX and ObjectContext API.