Using Ef+mysql in MVC

Source: Internet
Author: User

Recently, I tried to use MySQL in EF, so I tested it.

My environment is vs2013+ef6+mysql5.7.4.

The first thing to download is MySQL for VisualStudio 1.1.4, Connectornet 6.8.3 two things.

Then add entityframework (not EF5) and MySQL.Data.Entities (this is also version 6th) in the NuGet package.

Two DLLs that will be like when you add one

The EntityFramework node under the corresponding config file is then modified or added

<entityFramework>        <providers>      <provider invariantname= "MySql.Data.MySqlClient" type= " MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6 "/>    </providers> </ Entityframework>

Then you can add the MySQL entity by generating it from the database according to the usual method of adding entities.

 

As for the use of EF, and the operation of the MSSQL is not much different, it is no longer explained.

This article is just to record the EF connection to MySQL Memo!! Hope to help friends who meet the same problem

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.