KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have those methods: 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(); } When using: count(some_guid, x => x.IsMatch(entityId, inviterId, routeId, luggageTypeId)); I get the following exception: 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. What is the reason for this? How can I solve it?
Tags (comma-separated)
Save Edits
Cancel