Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Breeze with a Unit Of Work/Repository pattern

I was just wondering how I should go about implementing breeze's EFContextProvider in a separate data layer project. Also, since that project is a class library and not an MVC 4 application, how should I include this into my project? I don't really need the whole bag of tricks that is in the Breeze NuGet package, just EFContextProvider stuff. I want to implement a Unit of work pattern using the EFContextProvider DbContext wrapper, like John Papa has done in his wonderful pluralsight course. Has anyone done this yet? any tips?

Thanks

like image 864
mtleising Avatar asked Feb 27 '13 13:02

mtleising


2 Answers

We've got a more sophisticated sample coming called "TempHire" that has a full blown UoW with Repos and separate model projects.

Breeze.NET components (the .NET server-side helpers for a Breeze app ... if you're going with .NET) are all in a single .DLL They have no dependence on MVC at all ... zip. There is Web API stuff in there. Maybe that's what concerns you. Well ... remember that this is open source on GitHub. You are not constrained to the Breeze .DLL. Build your own out of the parts you want.

In my view, the UoW is a short hop from Repository. If you understand what a bounded context is and can translate that to a DbContext implementation, I figure you shouldn't need much help making the transition yourself. There's no magic to it.

For everyone I highly recommend Scott Allen's videos on Repository and UOW in the Pluralsight Design Patterns course ... perhaps the clearest, jargon-free exposition of these patterns I've ever seen.

like image 83
Ward Avatar answered Oct 30 '22 00:10

Ward


Here is a post from the Breeze folks about how to use a UoW and Repo on the server with Breeze http://www.breezejs.com/spa-template#server

like image 23
John Papa Avatar answered Oct 30 '22 00:10

John Papa