Paritosh
Paritosh

Reputation: 4503

connect entity framework directly to Microsoft Dynamics CRM

We are currently working on a project which was using SQL Server on the back end and was setup through Entity Framework. Recently we were asked to explore the possibility of using Dynamics CRM. Some issues arose which caused us not to use CRM completely, but business would like us to use it to hold the data, even though it uses SQL Server behind the scenes. We thought about connecting our existing code directly to database Dynamics CRM had created and updating data that way. For reads I believe it should be fine, but has anyone tried updates? CRM seems to have a lot of tables and i'm sure updating one through CRM has impacts on others, we weren't sure if updating it directly through Entity Framework will follow the same path, or things might be missing later down the road.

Upvotes: 0

Views: 2686

Answers (2)

raterus
raterus

Reputation: 2089

The Dynamics 365 Web API is a oData v4.0 interface, so you can connect this directly to Entity Framework. On the front end you'll have entities, but behind the scenes the API is being called. This is an appropriate customization that will be supported.

You can follow this document to see how to connect Entity Framework to an oData source (Dynamics)

Upvotes: 1

Matt Dearing
Matt Dearing

Reputation: 9386

From the list of CRM's Unsupported customizations:

Data (record) changes in the Microsoft Dynamics CRM database using SQL commands or any technology other than those described in the Microsoft Dynamics CRM SDK.

Which basically rules you out from being supported when reaching out to MSFT for assistance, performing upgrades, etc. Outside of being supported, going through the API enforces a lot of business rules (such as Security, Plugins, Metadata rules, etc.) that are not enforced by the database. The supported approach is going through CRM's API (e.g. Web API, Organization Service, etc.)

Upvotes: 3

Related Questions