Browse Source

MySql CodeFirst Sbyte

pull/9/head
sunkaixuna 3 years ago
parent
commit
cd71d6ebef
  1. 6
      Src/Asp.Net/MySqlTest/UnitTest/UCodeFirst.cs
  2. 2
      Src/Asp.Net/SqlSugar/Realization/MySql/DbBind/MySqlDbBind.cs

6
Src/Asp.Net/MySqlTest/UnitTest/UCodeFirst.cs

@ -36,6 +36,12 @@ namespace OrmTest
b=it.b
}).ToList();
Db.CodeFirst.InitTables<UnitTest012213>();
Db.CodeFirst.InitTables<UnitTest3131>();
}
public class UnitTest3131
{
public sbyte Id { get; set; }
}
public class UnitTest012213
{

2
Src/Asp.Net/SqlSugar/Realization/MySql/DbBind/MySqlDbBind.cs

@ -20,6 +20,8 @@ namespace SqlSugar
csharpTypeName = "long";
if (csharpTypeName == "Boolean")
csharpTypeName = "bool";
if (csharpTypeName == "SByte")
csharpTypeName = "Byte";
var mappings = this.MappingTypes.Where(it => it.Value.ToString().Equals(csharpTypeName, StringComparison.CurrentCultureIgnoreCase));
return mappings.HasValue() ? mappings.First().Key : "varchar";
}

Loading…
Cancel
Save