diff Source/Data/Linq/Builder/ExpressionBuilder.cs @ 5:f7d63a092920

Исправлено условие Where в тех случаях, когда репозитарий не является генериком
author cin
date Tue, 10 Mar 2015 16:02:11 +0300
parents f990fcb411a9
children 11b6da379593
line wrap: on
line diff
--- a/Source/Data/Linq/Builder/ExpressionBuilder.cs	Sun Aug 24 17:57:42 2014 +0400
+++ b/Source/Data/Linq/Builder/ExpressionBuilder.cs	Tue Mar 10 16:02:11 2015 +0300
@@ -692,7 +692,8 @@
 			if (sequence != method.Arguments[0] || predicate != method.Arguments[1])
 			{
 				var methodInfo  = method.Method.GetGenericMethodDefinition();
-				var genericType = sequence.Type.GetGenericArguments()[0];
+                var queryableType = sequence.Type.GetInterface(typeof(IQueryable<>).Name);
+                var genericType = queryableType.GetGenericArguments()[0];
 				var newMethod   = methodInfo.MakeGenericMethod(genericType);
 
 				method = Expression.Call(newMethod, sequence, predicate);