Last post Jun 18, 2014 02:39 PM by Rion Williams
Jun 18, 2014 12:39 PM|svetsarn|LINK
I have not done any coding for the last two years and I have forgotten alot. Now I will build a blog and need help with one thing. I will build it with MVC 5 and EF6. Is it good to use repository with EF6? I have red somewhere that it will not be good to
use repositor with EF6. If it is good do you know a good link where I can learn more about generic repository.
Jun 18, 2014 12:52 PM|PatriceSc|LINK
Try http://msdn.microsoft.com/en-us/library/ff649690.aspx or similar pattern explanation and see if you want some of the exposed benefits. IMHO a pattern itself is not good or not. It has
benefits. If you want its benefits go for it, if you don't want its benefits don't apply the pattern for its own sake.
somewhere that it will not be good
For samples try perhaps
https://github.com/CypressNorth/.NET-EF6-GenericRepository (I don't have given a look, just searched).
Jun 18, 2014 02:39 PM|Rion Williams|LINK
As with most things, it depends ultimately on what you intend to use it for. As Patrick pointed out, a pattern on it's own isn't going to be useful unless it is being used in the proper scenario.
The Repository pattern is an extremely popular one and you'll see it quite often within MVC-EF projects. It may be useful for you (again depending on your needs) and then again it might be a bit of overkill as well.
I would highly recommend going through the ASP.NET MVC Application using Entity Framework Code First Tutorial
on this site (it features a full sample at the end of the tutorial in both C# and Visual Basic). Part
9 of the tutorial specifically reviews over and implements the Repository Pattern.
A few more resources include :