Quantcast
Channel: URF - Unit of Work & (extensible/generic) Repositories Framework
Viewing all articles
Browse latest Browse all 1539

New Post: How to use existing Stored Procedures???

$
0
0
I am trying to start using all the patterns that you offer with this framework, btw cool, but at some point because my business rules demand it, I have to use an existing stored procedure in my project, but I don't know how to do it and where to put it in the classes structure.
I know that using EF we can do something like this:
public ICollection<Customer> GetCustomers(string company, string contactTitle)
{
return Database.SqlQuery<Customer>( "EXEC GetCustomers @Company, 
@ContactTitle"
, new SqlParameter("Company", company)
, new SqlParameter("ContactTitle", contactTitle))
.ToList();
}
thanks

Viewing all articles
Browse latest Browse all 1539

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>