How to perform projections on types other than IQueryable<T>
?
#5104
Replies: 2 comments
-
In V13 we provide a IProjectionContext that you can use to project yourself. Otherwise there is [UseFirstOrDefault] or [UseSingleOrDefault]. |
Beta Was this translation helpful? Give feedback.
-
Hi @arjundnair-fingent , I had the same problem because I needed the response as a List<>. This is how it worked for me while using the Entity Framework: Here is my query: And here my service |
Beta Was this translation helpful? Give feedback.
-
Hi,
I read from the HotChocolate documentation that projections work on
IQueryable<T>
by default. I would like to know whether it is possible to perform projections on types other thanIQueryable<T>
likeEnumerable<T>
orList<T>
. If it is possible, please do explain how to do it with an example. I've searched a lot on the internet for a solution, but not able to find anything related to this.Beta Was this translation helpful? Give feedback.
All reactions