💡

Entity Framework Core での C# と MySQL の型の対応表

2022/03/10に公開

環境

対象 version
dotnet 6.0.200
Pomelo.EntityFrameworkCore.MySql 6.0.1
MySQL 8.0.28

C#とMySQLの型の対応表

C# MySQL
bool tinyint(1)
byte tinyint unsigned
char varchar(1) CHARACTER SET utf8mb4
short smallint
ushort smallint unsigned
int int
uint int unsigned
long bigint
unlong bigint unsigned
string longtext CHARACTER SET utf8mb4
DateTime datetime(6)
DateTimeOffset datetime(6)
TimeSpan time(6)
Guid char(36) COLLATE ascii_general_ci
Uri longtext CHARACTER SET utf8mb4
IPAddress varchar(45) CHARACTER SET utf8mb4
enum int
byte[] longblob

Discussion