Effective ASP.NET MVC + Dynamics 365 Implementation

I started developing an ASP.NET MVC website that connects to a Dynamics 365 implementation.

The way I connect to Dynamics 365 is to use a separate data access layer on my MVC website that makes calls to Dynamics 365 every time I want to get / create / update an object.

So every time I wanted to get, for example, a contact list from Dynamics, I will create an OrganizationService instance using the CRMServiceClient class from the SDK and use it to query the CRM.

If at another time I needed to update the object, I will make an instance of OrganizationService again and use it to update the data in CRM.

Basically, on every operation, I always create an OrganizationService instance and query the CRM.

Is it the right thing to do? Are there any other approaches I can take that might have better performance?

+3


source to share


1 answer


You are probably better off creating the OrganizationService once and then saving it in application state. I don't have any empirical evidence for this, but I believe it might take a while to create the service object.

Adxstudio (which created the Microsoft CRM portals before they were acquired by Microsoft) also used the cache tier for data retrieved from the CRM to reduce the number of requests sent to the CRM and improve overall performance.



It might be worthwhile to profile the performance of both of these to see if your scenario is worth the extra effort of keeping objects in memory.

+4


source







All Articles