Walkthrough: Linq to CRM Visual Studio Add-In
This walkthrough shows you how you can use Linq to CRM using the XrmLinq Visual Studio Add-In. The Add-In supports Microsoft Dynamics CRM Online, Partner Hosted or Inhouse installations.
Requirements
- XrmLinq 1.5.3 or above
- XrmLinq Visual Studio Add-In 1.6.0
- Access to Dynamics CRM
- Visual Studio 2008, .NET 3.5
- CRM SDK 4.0.11 or above
Installing the Add-In
To begin, you’ll need to install the XrmLinq Visual Studio Add-In, first download a copy of the installer by logging into our portal. (http://www.xrmlinq.com/support/). The Add-In is FREE!
Creating a Visual Studio Solution
For this example we will be creating a simple console application and adding a new Linq to CRM file called CrmEntities1.xlinq.
- Open Microsoft Visual Studio
- Create a new console application project (preferably C#)
- Right click on the project -> Add -> Add New Item and select “Linq to CRM classes“
Using the (xlinq) Linq to CRM Designer
Once you have added an xlinq (linq to crm) file, double click on it to open the designer.
- Click on the ‘Connect to crm‘ button
- Change the default connection settings to match your environment, please see the getting started guide if you need detailed information about this screen.
- Click on ‘Connect‘
The add-in will get entity metadata from crm and generate c# code accordinly, this process will take 2-5 minutes depending on your connection speed. - Press CTRL + S to save the .xlinq file. * This is required to generate the code.
Features
- Stay inside Visual Studio
- Modify generated code using the designer
- Sync with crm without losing the changes you’ve made
Quick Tips
- Right click on the .xlinq file -> Update Mapping to update without opening the designer
- Double click on any entity, property or list to rename
- Hit the [ESC] key to exit the rename window
- Higlight and hit the [F2] key to rename (similar to windows explorer)
- Code generation properties such as namespace, wcf, data annotations and linq are set within the properties window
- To skip code generation for entities specify a comma seperated list of schema names of the entities you want skipped (must click on re-generate code)
- To keep your changes and still synchronize with the crm server click on the ‘Sync with crm‘ button
Please place your feedback within the feedback form below, we’d love to hear your ideas!







