- 修复 Guid -> MapType(string) 在 FreeSql.DbContext 的类型转换错误;

This commit is contained in:
28810
2020-04-22 13:08:38 +08:00
parent fc4e834452
commit 7311ae600c
3 changed files with 15 additions and 16 deletions

View File

@ -55,6 +55,7 @@ namespace FreeSql.Extensions.EntityUtil
{
Expression newguid = Expression.Call(MethodFreeUtilNewMongodbId);
if (pks[a].Attribute.MapType != pks[a].CsType) newguid = FreeSql.Internal.Utils.GetDataReaderValueBlockExpression(pks[a].CsType, newguid);
if (pks[a].CsType == typeof(Guid)) newguid = Expression.Convert(newguid, typeof(Guid));
if (pks[a].CsType == typeof(Guid?)) newguid = Expression.Convert(newguid, typeof(Guid?));
expthen = Expression.Block(
new Expression[]{