From 78e9e732fae7347e53961ffc248a702f7dc432cd Mon Sep 17 00:00:00 2001 From: Paulo Victor Lund Date: Thu, 27 Feb 2020 21:51:02 -0300 Subject: [PATCH] Update ExpressionHelper.cs This will add support for TypeHandlers --- .../SqlGenerator/ExpressionHelper.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MicroOrm.Dapper.Repositories/SqlGenerator/ExpressionHelper.cs b/src/MicroOrm.Dapper.Repositories/SqlGenerator/ExpressionHelper.cs index cce694dc..fdd7e48a 100644 --- a/src/MicroOrm.Dapper.Repositories/SqlGenerator/ExpressionHelper.cs +++ b/src/MicroOrm.Dapper.Repositories/SqlGenerator/ExpressionHelper.cs @@ -1,4 +1,5 @@ using System; +using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Linq.Expressions; using System.Reflection; @@ -137,7 +138,7 @@ public static BinaryExpression GetBinaryExpression(Expression expression) public static Func GetPrimitivePropertiesPredicate() { - return p => p.CanWrite && (p.PropertyType.IsValueType || p.PropertyType == typeof(string) || p.PropertyType == typeof(byte[])); + return p => p.CanWrite && (p.PropertyType.IsValueType || p.GetCustomAttributes().Any() || p.PropertyType == typeof(string) || p.PropertyType == typeof(byte[])); } public static object GetValuesFromStringMethod(MethodCallExpression callExpr)