Open BCS Model Created in SharePoint Designer 2010 in Visual Studio 2010

SharePoint Designer 2010 is great for creating relatively simple External Content Types. But what happens if you want to go from something simple and make it more complex by extending it further using a .Net Assembly Connector. If you are using the SharePoint Tools for Visual Studio 2010 you’ll need to start from scratch, but if you are using BCS Meta Man you can get it to open your SPD 2010 model and convert the methods to C# code for you!

Prerequisites

  • SharePoint Foundation 2010 or SharePoint Server 2010
  • Visual Studio 2010 professional or higher
  • SharePoint Designer 2010
  • BCS Meta Man
  • External Content Types created by SharePoint designer 2010
  • AdventureWorks SQL database

Walkthrough

  1. Create a new BCS Meta Man project by selecting ‘SharePoint’ > ‘Lightning Tools (2010)’ , now you can select the BCS Meta Man project type.
  2. Click ‘OK’
  3. On the next dialog box, enter the name of where you want to deploy your model, and make sure you select ‘Deploy as a farm solution’ , click ‘Finish’

    Deploy it as a farm solution 

  4. We need to export our external content types to an XML file so then we can upgrade them in BCS Meta Man. With SharePoint Designer 2010 open and while viewing the External Content Types, select and right click on the ones you want to upgrade and select Export Application Model.

    Export your External Content Types 

  5. Set Model Name.

    Set the Model Name

  6. Set where you want to save the model file to, and the file name

    Choose where to save the BCS Model to

  7. Now we have our application model of external content types as an XML file. Next we will show you how to upgrade it in BCS Meta Man, which will generate C# methods for all the methods that you have defined in SharePoint Designer and also it will generate the associations between them as well.
  8. Open up your BCS Meta Man diagram and select import SPD Xml from the menu.

    Import your BCS Model to BCS Meta Man
     

  9. A File open dialog will show. Select the xml file that you saved in step 4.

    Select the model file

  10. BCS Meta Man will create External Content Types for all the ECTs that were created in SPD 2010 and exported. It will add new C# class files to your project so you can modify the C# methods that have been generated for each BCS method

    BCS Meta Man will generate all the External Content Types and code for you

  11. Rebuild the project and press CTRL+F5 to deploy the solution. You can now use your External Content Types that were originally designed in SharePoint Designer 2010 through a .Net Assembly Connector – woohoo

<hrayr/>