© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
12 replies
SWEETPONY

✅ How to get arguments from one method and pass them to another extension?

I have following:
var subjects = await _subjectServiceClient
    .QueryQl(filter,fieldSet)
    .WithChunks();
var subjects = await _subjectServiceClient
    .QueryQl(filter,fieldSet)
    .WithChunks();


What I want:
1. if user don't use
WithChunks
WithChunks
extension than I just need to run all logic inside
QueryQl 
QueryQl 

2. if user use
WithChunks
WithChunks
than I need to run logic inside
WithChunks
WithChunks


now it looks simple:
static public async Task<List<T>> WithChunks<T>(this Task<MqttResult<T>> task)
{
    return null;
}
static public async Task<List<T>> WithChunks<T>(this Task<MqttResult<T>> task)
{
    return null;
}


WithChunks
WithChunks
is smth generic so I don't need to pass
filter, fieldSet
filter, fieldSet
, I want to get it from
task
task
but how can I do it?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How do i pass data from one form to another?
C#CC# / help
4y ago
❔ how to pass multiple arguments in apicall from ajex get url?
C#CC# / help
4y ago
How to pass List<string> from one action to another using TempData
C#CC# / help
2y ago
How to pass variable from one View to another View in link?
C#CC# / help
3y ago