❔ Calling extensions method in linq query
Hi, is there any way to use my own extension method in a linq to query? With the approach below, it throws me an exception about the method not being able to be translated to SQL. If I add ..AsEnumerable().Select(...).AsQueryable() will it be a correct solution?
6 Replies
Stack Overflow
Workarounds for using custom methods/extension methods in LINQ to E...
I have defined a GenericRepository class which does the db interaction.
protected GenericRepository rep = new GenericRepository(); And in my BLL classes, I can query the db like:
public Li...
protected GenericRepository rep = new GenericRepository(); And in my BLL classes, I can query the db like:
public Li...
this is what I found
Engineering Education (EngEd) Program | Section
Adding Custom Methods to LINQ Queries in C#
This article will explain how to add custom methods to LINQ queries and how to customize LINQ queries. We will develop an application that retrieves JSON data from an API, query the data using the LINQ queries.
Packt
Extension methods on IQueryable (Become an expert) | Instant .NET 4...
IQueryable is used to operate mainly on databases. IQueryable are an extension from IEnumerable, hence, we can call all extensions and methods of IEnumera
no, converting to
IEnumerable
will evaluate that on the client.
in your case it doesn't matter
but in general, don't do thatWas this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.