In order to learn the ORM, chose the EntityFramework, experienced three days and two nights of suffering, n times wrong, in the group of the help of master, finally succeeded, now will my mind history record down, one is let oneself have a record, another is let other people less go some detours.
My development environment is win7+vs2012, and the database environment is Ubuntu12.04+mysql+mono+jexus
After the program has been developed, the whole runs under Linux.
1. Download MySQL connector/net 6.8.3
Address: http://dev.mysql.com/downloads/connector/net/
There are several versions that need to refer to another article about which version to use: Upstream's blog "about the registration of Linux and the deployment of Mysql.data.dll under Windows"
You also need to download a MySQL for VisualStudio version that you can use to reference MySQL in the data source in VS
Address: "Mysql for Visual Studio" http://www.05sun.com/downinfo/97255.html
2, download and install EF6 (I do not know if this step is necessary, you can try and tell me, because there are also installed in NuGet, do not know whether it is a meaning, the following will write the concrete method)
Address: http://www.microsoft.com/en-us/download/details.aspx?id=40762
3. Open VS2012, create a new project
4, in the project first install EF6.
Click "Package Manager Console".
5. The interface will appear below the code
6. After "Pm>", enter:
Install-package EntityFramework
7, re-enter: Install-package MySql.Data.Entity.EF6
<invariantname= "MySql.Data.MySqlClient" type= " MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6 "/>
9, regenerate the entire solution, in the project right-"add-" New item
10. Select: Data-"ADO Entity Data Model"
Vs2012+ef6+mysql Configuring your Mind history