Update mysql json bug

This commit is contained in:
sunkaixuan 2023-02-26 14:37:24 +08:00
parent 85495383bd
commit 3391e89d71
2 changed files with 5 additions and 1 deletions

View File

@ -92,6 +92,10 @@ namespace SqlSugar
{
result.DataType = this.Context.Ado.DbBind.GetDbTypeName(item.Length > 9 ? UtilConstants.LongType.Name : UtilConstants.IntType.Name);
}
else if (item.IsJson && item.DataType == null)
{
result.DataType = "json";
}
else
{
var name = GetType(propertyType.Name);

View File

@ -25,7 +25,7 @@ namespace SqlSugar
if (csharpTypeName == "DateTimeOffset")
csharpTypeName = "DateTime";
var mappings = this.MappingTypes.Where(it => it.Value.ToString().Equals(csharpTypeName, StringComparison.CurrentCultureIgnoreCase));
return mappings.HasValue() ? mappings.First().Key : "varchar";
return (mappings?.Any()==true) ? mappings.First().Key : "varchar";
}
public override List<KeyValuePair<string, CSharpDataType>> MappingTypes
{