Using EF in SharePoint read this first


Entity Framework (EF) is one of the best framewok that i love , it makes data layer things quicker,safer and better for us. Well using Entity Framework inside of SharePoint (i mean in same worker process) ,if you not expert level experiance enough with EF and don’t know what you do ; using it in SharePoint is not a good idea , SharePoint itself is a huge web Application ever developed even you did not make any customization. Billons of code and hundreds of assemlies are behind in a simple SharePoint site   And any integration using EF ( except small implementations) If you make easily something wrong or not calculate the data grow you must highly face a performance issues. And trying to troubleshoot it inside the sharepoint it is not an easy task.

A highly utilized SharePoint site, has already consume many of your system Resources , even out side of the SharePoint , an ASP.Net Application using EF can easily comsumes your resouces .(Yeah it depends what you do) . both heavy Operations in same place is not a wise decision .

For SharePoint 2010 it is not posible. SharePoint 2010 based on the .NET FrameWork 3.5, which requries IIS to use the ASP.NET 2.0 Runtime. Entity Framework 4.1 or higher builds uses the .NET FrameWork 4.0, which requries IIS to use the ASP.NET 4.0 runtime. As a result you cannot run EF 4.1 or higher builds natively in SharePoint 2010.

For SharePoint 2013 use .NET framewok 4.0 , and there is no restriction to use EF inside SharePoint 2013 processes. But you really want to use it , i would suggest do it out side of the SharePoint . Create a WCF/Web service  and use your data logic , caching etc outside of the SharePoint and consume it from SharePoint side .It will provide you flexibility , compatibility ,stability and easy troubleshooting if you face any problem.

Well , Microsoft makes all investments on cloud Technologies and the SharePoint Online is our future , you could not use any Server OM tools with SharePoint Online , Unfortunately EF implementation inside SharePoint included , so if you have any kind of EF implementation inside SharePoint will not be supported for SPO if you have any plan for migration .

Advertisements

About bpostaci
Escalation Engineer in Microsoft.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: