Implementing Repository pattern and doing Tests

I have read almost all articles about Repository pattern and different implementations of it. Many of them judged bad practices (ex: using IQueryable<T> instead of IList<T>) etc. that why i'm still stuck and couldn't end-up to the right one.

So:

  • Do I need Repository pattern to apply IoC in my MVVM applications ?

  • If yes, What is the efficient IRepository implementation to EF Entities which is a good practice and better testable ?

  • How can I test my Repositories and UnitofWork behavior ? Unit tests against in memory Repositories ? Integration tests ?

Edit : According to answers I added the first question.

Answers


Ayende Rahien has a lot of posts about repository http://ayende.com/blog/search?q=repository and why it is bad when you are using ORM's. I thought Repository was the way to go. Maybe it was, in 2004. Not now. ORM's already implement repository. In case of EF it is IDbSet. And DbContext is UnitOfWork. Creating a repository to wrap EF or other ORM's adds a lot of unnecessary complexity.

Do integration testing of code that will interact with database.


Need Your Help

Swift: Navigation Bar disappears after programatically embedding tab bar controller

ios swift

I have just programatically embedded a tab bar controller into my app, however it seems to have forced my Storyboard embedded Navigation Bars to disappear, I assume this is because I have now set the