I have seen here and there that Entity framework and Linq works with SharePoint. But can we use Entity framework Database first approach in SharePoint?


Here they only highlights model and and code first. I suppose because they use SharePoint Lists. But i want to use an external database with EF so db first would suit me more as i don't want to migrate data from my external db to sharepoint lists.

Any links to tutorials or exiting technology is welcome.

Thank you

1 Answer 1


Database first approach using EF with external database , the steps are more or less same as in any plain .NET project. You can look at below blogs:



To get info about CRUD Operations:



  1. Create a farm solution (since you want to deploy webparts).
  2. Add new project and add the EF component in this project.
  3. In the main project , you can add webpart and that webpart can use your EF entities for CRUD operations.
  • Yes you can add new project into your solution and that project will implement EF component. In your main project , webparts can access the EF classes to do CRUD
    – Unnie
    Oct 7, 2015 at 8:09
  • So i can make a webPart that uses EF database first and hten deploy it on sharepoint all that with my external to SharePoint database?
    – user28470
    Oct 7, 2015 at 8:11
  • See my edited answer
    – Unnie
    Oct 7, 2015 at 8:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.