tengo esos métodos:LINQ a las entidades no reconoce un método
public int count(
Guid companyId, Expression<Func<T, bool>> isMatch)
{
var filters = new Expression<Func<T, bool>>[]{
x => x.PriceDefinition.CompanyId == companyId,
isMatch
};
return GetCount(filters);
}
public virtual int GetCount(
IEnumerable<Expression<Func<T, bool>>> filters)
{
IQueryable<T> _query = ObjectSet;
if (filters != null)
{
foreach (var filter in filters)
{
_query = _query.Where(filter);
}
}
return _query.Count();
}
Al utilizar:
count(some_guid, x => x.IsMatch(entityId, inviterId, routeId, luggageTypeId));
tengo la siguiente excepción:
LINQ to Entities does not recognize the method 'Boolean IsMatch(System.Nullable`1[System.Int64], System.Nullable`1[System.Int64], System.Nullable`1[System.Int64], System.Nullable`1[System.Int64])' method, and this method cannot be translated into a store expression.
Cuál es el razón por esto?
¿Cómo puedo resolverlo?
¿Cuáles son sus filtros? – SLaks
@ SLaks ♦: Lo siento, actualicé la pregunta con el delegado de isMatch. – Naor