简体   繁体   中英

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.

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 (eg Web API , Organization Service , etc.)

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM