From acd406164a35e8b64d1474c44c34c7ed8d0fe938 Mon Sep 17 00:00:00 2001 From: 28810 <28810@YEXIANGQIN> Date: Mon, 18 Nov 2019 19:12:50 +0800 Subject: [PATCH] Property set method not found #132 --- FreeSql/Internal/CommonExpression.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FreeSql/Internal/CommonExpression.cs b/FreeSql/Internal/CommonExpression.cs index 084ac167..b83db6ff 100644 --- a/FreeSql/Internal/CommonExpression.cs +++ b/FreeSql/Internal/CommonExpression.cs @@ -251,7 +251,7 @@ namespace FreeSql.Internal var objval = ReadAnonymous(parent.Childs[b], dr, ref index, notRead); if (isnull == false && objval == null && parent.Table != null && parent.Table.ColumnsByCs.TryGetValue(parent.Childs[b].CsName, out var trycol) && trycol.Attribute.IsPrimary) isnull = true; - if (isnull == false) + if (isnull == false && prop.CanWrite) prop.SetValue(ret, objval, null); } return isnull ? null : ret;