Replies: 1 comment 1 reply
-
No, it is impossible to use it like that because the source generator
wouldn't be able to figure out the selector in compile time.
…On Mon, Oct 30, 2023, 16:49 cmpbedes ***@***.***> wrote:
I'm writing an abstraction over the ZeroQL-generated code and was
wondering if there's a way to specify the output of the query as a
parameter instead, something like this:
//lambda approach:
Task<User> GetMyUser(){
return _client.Query(q => q.Me(x => new { x.FirstName, x.Surname }));}
//Func approach
Task<T> GetMyUser<T>(Func<User, T> selector){
return _client.Query(q => q.Me(selector));}
—
Reply to this email directly, view it on GitHub
<#78>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABNHGBTIBLVA4YDY7HV5PXDYB646XAVCNFSM6AAAAAA6WEYCW6VHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZVG44TINBTGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
cmpbedes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm writing an abstraction over the ZeroQL-generated code and was wondering if there's a way to specify the output of the query as a parameter instead, something like this:
Beta Was this translation helpful? Give feedback.
All reactions