diff Source/Data/Linq/ReflectionHelper.cs @ 4:f757da6161a1

!bug 100 + 2h fixed gregression
author cin
date Sun, 24 Aug 2014 17:57:42 +0400
parents 1ef98bd70424
children
line wrap: on
line diff
--- a/Source/Data/Linq/ReflectionHelper.cs	Fri Aug 22 17:34:46 2014 +0400
+++ b/Source/Data/Linq/ReflectionHelper.cs	Sun Aug 24 17:57:42 2014 +0400
@@ -42,12 +42,7 @@
 				//	return ((PropertyInfo)((MemberExpression)ex).Member).GetGetMethod();
 
 				/// HACK
-				var mce = (MethodCallExpression)ex;
-				var mi = mce.Method;
-				if (mi.IsVirtual && mi.DeclaringType != mce.Object.Type)
-					mi = mce.Object.Type.GetMethod(mi.Name, mi.GetParameters().Select(p => p.ParameterType).ToArray());
-
-				return mi;
+				return ExtractMethodInfo ((MethodCallExpression)ex);
 			}
 		}
 
@@ -66,7 +61,7 @@
 
 		public static MethodInfo ExtractMethodInfo(MethodCallExpression mce) {
 			var mi = mce.Method;
-			if (mi.IsVirtual && mi.DeclaringType != mce.Object.Type)
+			if (mi.IsVirtual && mi.DeclaringType != mce.Object.Type && !mce.Object.Type.IsInterface)
 				mi = mce.Object.Type.GetMethod(mi.Name, mi.GetParameters().Select(p => p.ParameterType).ToArray());
 
 			return mi;