Can someone clarify how to integrate the Entity Framework with Angular and Breeze? Also, do I need to use EFContextProvider in order for BreeeJS to work with the EF interface? I am trying to use the Database first approach and importing my EF model. I am not too clear as to why EFContextProvider is necessary in the first place as opposed to using the default EF context. What customizations does it have that make it unique for Breeze, assuming it is needed. Thanks
2 Answers
The Breeze components for .NET server development are never required. They exist to make server development easier and Breeze client technologies (BreezeJS and Breeze.Sharp) "understand" their behavior out-of-the-box.
You are welcome to use the EFContextProvider with a "Database-First" DbContext or the older ObjectContext.
If you go your own way, you'll have to teach the client to work with whatever server conventions you create in lieu of the Breeze ContextProvider conventions. I strongly suggest sticking with the Breeze components at least until you develop a deeper familiarity with how all the parts come together.
EFContextProvider extracts metadata from your models to generate client side view model definitions. Its a powerful feature, because the alternative is to type in all the view models by hand in JavaScript which is messy and a maintenance nightmare.
However, there is no reason you cannot build your models the way you want. (In your case using Database first approach and importing EF models). The EFContextProvider, uses DbContext class to extract the metadata only, not connect to the database. So you could build a second dbcontext class that would list all the models that you want your views to have access to and point your EFContextProvider to that class.