Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

EF based Repository pattern and store procedure calling

$
0
0

i was searching google for this subject and found one link http://stackoverflow.com/a/27975496/728750

the person saying

The purpose of the Repository Pattern is to abstract away the storage & retrieval of data to protect your client code e.g. 
business layer (service layer in your case) from needing to know anything about how data is persisted. SQL statements,
for example, would only exist inside your Repository classes, and not ripple throughout your code. If you expose SQL, Stored Procedure names and parameters to your client code your are not getting much benefit from the Repository Pattern,
and if fact you can't really call it a Repository at all. You lose the benefit of being able to mock the repository and test your
business layer independently of your data access layer. This means integration tests (requiring a full database instance)
are required to verify business logic.

may be he is right but we often work with sql server store procedure for achieving complex query with many loop/if..else etc.

so tell me how could i achieve store procedure calling with EF based Repository pattern ?

looking for great example which will be widely accepted when some one review the code.

few more links for same issues

http://stackoverflow.com/a/27974909/728750
http://stackoverflow.com/a/19016295/728750
http://stackoverflow.com/a/29537234/728750
http://code-clarity.blogspot.in/2012/02/entity-framework-code-first-easy-way-to.html
https://www.codeproject.com/Articles/1037947/Implementing-Repository-pattern-and-Dependency-Inj
https://www.codeproject.com/Articles/526874/Repositorypluspattern-cplusdoneplusright
http://www.c-sharpcorner.com/UploadFile/b1df45/getting-started-with-repository-pattern-using-C-Sharp/

thanks


Viewing all articles
Browse latest Browse all 1698

Trending Articles



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