Question

I have recently been reading up on the MVC tutorials on ASP.NET and most if not all of the tutorials use Entity Framework and DbContext to perform CRUD operations on data.

I'm planning to create an ASP MVC application which uses Dynamics CRM 4 as the data store. With this in mind, where would the best place be to write the logic to perform CRUD operations using the CRM SDK, the Model, the Controller or something else?

Was it helpful?

Solution

I would encourage you to encapsulate all of the CRM data-access logic in a separate layer/assembly that would then be consumed by your controller(s). Those tutorials shouldn't really be doing database communication directly from the controllers, either, regardless of using EF/DbContext. Or they should at least point out a better way of organizing things.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top