Browse Source

Update CodeFirst

pull/30/head
sunkaixuan 2 years ago
parent
commit
f765c2164e
  1. 4
      Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs
  2. 1
      Src/Asp.Net/SqlSugar/Infrastructure/StaticConfig.cs
  3. 1
      Src/Asp.Net/SqlSugar/Realization/SqlServer/DbBind/SqlServerDbBind.cs

4
Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs

@ -231,6 +231,10 @@ namespace SqlSugar
{
item.DataType = mappingType;
}
if (item.DataType == "varcharmax")
{
item.DataType = "nvarchar(max)";
}
}
}
}

1
Src/Asp.Net/SqlSugar/Infrastructure/StaticConfig.cs

@ -8,5 +8,6 @@ namespace SqlSugar
{
public static Func<string,string> Encode { get; set; }
public static Func<string,string> Decode{ get; set; }
public const string CodeFirt_BigString = "varcharmax,longtext,text,clob";
}
}

1
Src/Asp.Net/SqlSugar/Realization/SqlServer/DbBind/SqlServerDbBind.cs

@ -38,6 +38,7 @@ namespace SqlSugar
new KeyValuePair<string, CSharpDataType>("varchar",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("nvarchar",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("sql_variant",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("varcharmax",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("text",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("char",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("ntext",CSharpDataType.@string),

Loading…
Cancel
Save