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

Исправлено условие Where в тех случаях, когда репозитарий не является генериком
author cin
date Tue, 10 Mar 2015 16:02:11 +0300
parents f990fcb411a9
children 11b6da379593
comparison
equal deleted inserted replaced
4:f757da6161a1 5:f7d63a092920
690 } 690 }
691 691
692 if (sequence != method.Arguments[0] || predicate != method.Arguments[1]) 692 if (sequence != method.Arguments[0] || predicate != method.Arguments[1])
693 { 693 {
694 var methodInfo = method.Method.GetGenericMethodDefinition(); 694 var methodInfo = method.Method.GetGenericMethodDefinition();
695 var genericType = sequence.Type.GetGenericArguments()[0]; 695 var queryableType = sequence.Type.GetInterface(typeof(IQueryable<>).Name);
696 var genericType = queryableType.GetGenericArguments()[0];
696 var newMethod = methodInfo.MakeGenericMethod(genericType); 697 var newMethod = methodInfo.MakeGenericMethod(genericType);
697 698
698 method = Expression.Call(newMethod, sequence, predicate); 699 method = Expression.Call(newMethod, sequence, predicate);
699 700
700 if (exprs.Count > 0) 701 if (exprs.Count > 0)