Skip to main content
9 events
when toggle format what by license comment
Apr 15, 2014 at 21:22 comment added dreza @agarwaen Just a note. I'm not completely saying to not use a separate repository layer. Just at times it might not be required so this is a potential alternative. Glad it helped anyway.
Apr 15, 2014 at 21:18 comment added rareyesdev you are right. I think that the ability of mocking for TDD and maintainability are the main benefit of having good abstraction. I'll take a deep look at your code. Thanks again. This post was very helpful to me. +1 and accepted.
Apr 15, 2014 at 21:18 vote accept rareyesdev
Apr 15, 2014 at 21:11 comment added dreza @agawrwaen yes I guess to a certain extent you are however there are entity framework implementations for other databases. It's not just tied to sql (I think). Also, how often do you honestly change data access technology in the life of a project?
Apr 15, 2014 at 21:07 history edited dreza CC BY-SA 3.0
Added example of service layer
Apr 15, 2014 at 21:01 comment added rareyesdev Thanks a lot. I'll wait for your example. Just a thought: If you consider EF as your data layer then if you want to mock its functionality you need to provide a custom implementation for IDbContext, IDbSet, etc. Interesting... I never implemented those interfaces before. Can't be too hard. Every time I needed to mock data access I just implemented new repositories. One more thing. By using this approach you are giving up to change data access technology in the future. Am I wrong?
Apr 15, 2014 at 20:43 comment added dreza @agarwaen I guess I'm considering EF already being the data layer and providing that abstraction. I'll try and put an example of a layer using a service type approach (or my understanding of it anyway)
Apr 15, 2014 at 17:10 comment added rareyesdev Thank you for your answer, it was really helpful. I agree with you in most of it. But I can't understand how you archive abstraction from EF without adding an extra layer (maybe using a different kind of dependency injection). If you can put some example that will be great.
Apr 11, 2014 at 10:11 history answered dreza CC BY-SA 3.0