entity framework mysql provider_Pomelo.EntityFrameworkCore.MySql是构建在MySqlConnector之上的Entity Framewor...

Pomelo.EntityFrameworkCore.MySql

68747470733a2f2f6465762e617a7572652e636f6d2f706f6d656c6f2d6566636f72652f506f6d656c6f2e456e746974794672616d65776f726b436f72652e4d7953716c2f5f617069732f6275696c642f7374617475732f506f6d656c6f466f756e646174696f6e2e506f6d656c6f2e456e746974794672616d65776f726b436f72652e4d7953716c3f6272616e63684e616d653d6d617374657268747470733a2f2f696d672e736869656c64732e696f2f6e756765742f762f506f6d656c6f2e456e746974794672616d65776f726b436f72652e4d7953716c2e7376673f7374796c653d666c61742d737175617265266c6162656c3d6e7567657468747470733a2f2f66656564732e6465762e617a7572652e636f6d2f706f6d656c6f2d6566636f72652f65383166306235392d616261342d343035352d386531382d6533663161353635393432652f5f617069732f7075626c69632f5061636b6167696e672f46656564732f35663230326537652d326336322d346663312d613138632d3430323561333265616263382f5061636b616765732f35343933356363302d663338622d346464622d383664362d6338313261386339323938382f426164676568747470733a2f2f6261646765732e6769747465722e696d2f506f6d656c6f466f756e646174696f6e2f486f6d652e737667

Pomelo.EntityFrameworkCore.MySql is the most popular Entity Framework Core provider for MySQL compatible databases. It supports EF Core 3.1 (and lower) and uses MySqlConnector for all its database server communications.

Compatibility

EF Core and .NET Standard

The following versions of EF Core and .NET Standard are compatible with Pomelo.EntityFrameworkCore.MySql:

Pomelo.EntityFrameworkCore.MySql

EF Core

.NET Standard

.NET Core

.NET Framework

3.1.x

2.0

2.0+

4.6.1+

3.0.x

2.1

3.0+

N/A

2.2.6

2.0

2.0+

4.6.1+

Supported DBMS and Versions

Pomelo.EntityFrameworkCore.MySql is tested against the latest 2 minor versions of MySQL and MariaDB. Older versions and other server implementations may be compatible (and likely are, at least partially) but are not officially supported or tested.

Currently supported versions are:

MySQL 8.0

MySQL 5.7

MariaDB 10.4

MariaDB 10.3

Schedule and Roadmap

Milestone

Status

Release Date

3.2.0

In Development

TBA

3.1.1

Released

2020-01-15

3.1.0

Released

2019-12-16

3.0.1

Released

2019-12-04

3.0.0

Released

2019-11-18

2.2.6

Released

2019-10-15

2.2.0

Released

2019-02-07

2.1.4

Released

2018-11-29

Nightly Builds

To use nightly builds from our Azure DevOps feed, add a NuGet.config file in your solution root with the following contents:

Getting Started

1. Recommended Server CharSet

We recommend to set utf8mb4 as your MySQL database default charset. This is already the server default in MySQL 8. The following statement will check your current database charset:

show variables like 'character_set_database';

2. CSPROJ Configuration

Ensure that your .csproj file contains the following reference:

3. Services Configuration

Add Pomelo.EntityFrameworkCore.MySql to the services configuration in your the Startup.cs file.

using System;

using Microsoft.EntityFrameworkCore;

using Pomelo.EntityFrameworkCore.MySql.Infrastructure;

// replace "YourNamespace" with the namespace of your application

namespace YourNamespace

{

public class Startup

{

public void ConfigureServices(IServiceCollection services)

{

// other service configurations go here

// replace "YourDbContext" with the class name of your DbContext

services.AddDbContextPool(options => options

// replace with your connection string

.UseMySql("Server=localhost;Database=ef;User=root;Password=1234;", mySqlOptions => mySqlOptions

// replace with your Server Version and Type

.ServerVersion(new Version(8, 0, 18), ServerType.MySql)

));

}

}

}

View our Configuration Options Wiki Page for a list of common options.

4. Sample Application

Check out our Integration Tests for an example repository that includes a MVC Application.

5. Read the EF Core Documentation

Refer to Microsoft's EF Core Documentation for detailed instructions and examples on using EF Core.

Scaffolding / Reverse Engineering

Use the EF Core tool to execute scaffolding commands:

dotnet ef dbcontext scaffold "Server=localhost;Database=ef;User=root;Password=123456;TreatTinyAsBoolean=true;" "Pomelo.EntityFrameworkCore.MySql"

Contribute

One of the easiest ways to contribute is to report issues and participate in discussions on issues. You can also contribute by submitting pull requests with code changes and supporting tests.

Pomelo.EntityFrameworkCore.MySql is always looking for additional core contributors. If you got a couple of hours a week and know your way around EF Core, give us a nudge.

License

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值