0

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?

http://cdn.rssbus.com/help/RS3/ado/pg_usingEFIntro.htm

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

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:

https://www.asp.net/mvc/overview/getting-started/database-first-development/setting-up-database

http://www.asp.net/mvc/overview/getting-started/database-first-development/creating-the-web-application

To get info about CRUD Operations:

http://www.codeproject.com/Tips/869553/CRUD-operation-with-Entity-Framework-Database-Fi

Edit:

  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.
| improve this answer | |
  • 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 '15 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 '15 at 8:11
  • See my edited answer – Unnie Oct 7 '15 at 8:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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