- 增加 实体属性 char 类型的映射#381 #235;

This commit is contained in:
28810
2020-07-22 09:44:12 +08:00
parent cd60c9dbd9
commit 72739a27c6
53 changed files with 232 additions and 502 deletions

View File

@ -51,7 +51,7 @@ namespace FreeSql.SqlServer
return string.Concat("N'", param.ToString().Replace("'", "''"), "'");
}
else if (param is char)
return string.Concat("'", param.ToString().Replace("'", "''"), "'");
return string.Concat("'", param.ToString().Replace("'", "''").Replace('\0', ' '), "'");
else if (param is Enum)
return ((Enum)param).ToInt64();
else if (decimal.TryParse(string.Concat(param), out var trydec))

View File

@ -40,6 +40,7 @@ namespace FreeSql.SqlServer
{ typeof(byte[]).FullName, CsToDb.New(SqlDbType.VarBinary, "varbinary", "varbinary(255)", false, null, new byte[0]) },
{ typeof(string).FullName, CsToDb.New(SqlDbType.NVarChar, "nvarchar", "nvarchar(255)", false, null, "") },
{ typeof(char).FullName, CsToDb.New(SqlDbType.Char, "char", "char(1)", false, null, '\0') },
{ typeof(Guid).FullName, CsToDb.New(SqlDbType.UniqueIdentifier, "uniqueidentifier", "uniqueidentifier NOT NULL", false, false, Guid.Empty) },{ typeof(Guid?).FullName, CsToDb.New(SqlDbType.UniqueIdentifier, "uniqueidentifier", "uniqueidentifier", false, true, null) },
};