Step 2 – WCF Data Services – Entity Framework Model

21 Feb

This post is Step 2 in a Quick Start tutorial on how to create WCF Data Services

Using the Entity Framework is a great way to model the database and serve up our data although if you are using MySQL as your data source like me, you will need to install the connector for .NET which will allow Entity Framework to import from a MySQL.  The Connector can be downloaded here

1. Once the connector is installed open Visual studio ‘create a new Project’

2. Within the Project click to Add a New Item – ADO.NET Entity Data Model and name it ‘companyModel’

3. When the Entity Data Model Wizard appears click ‘Generate from database’

4. On the Connection screen hit ‘New Connection’ and on the following Connection Properties screen you should be able to select the MySQL driver (if the connector successfully installed) and complete your credentials for the database:

Connection Properties for the MySQL Data Source

5. Select to import all the tables we created in step 1 and click finish to generate the model and if all goes correctly you should end up with the data structure created in step 1, imported into the Entity Framework

Entity Framework model representing the MySQL Data Structure

Follow the link for Step 3 where we expose this data using a WCF Data Service

Step 3 – The WCF Data Service


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: