Greetings to all
I am using unit of work, repository pattern with entity framework 6 (code first approach) along with dependency injection,
I have extended my repository to execute stored procedures as below
public List<tentity> ExecuteStoreProcedure(IUnitOfWork unitofWork, string spName, params object[] parameters)
{
return ((DataContext)unitofWork.getDBContext()).Database.SqlQuery<tentity>(spName, parameters).ToList();
}
my questions are.
1.How can I call my call my stored procedures using this design pattern(is what I am doing is correct).
2.How can I make entity framework generate classes to hold the data from my stored procedures on the fly(<tentity>).
a) I have lots of stored procedures and I do not want to create POCO classes for all of them.