© 2026 Hedgehog Software, LLC

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

✅ How to get ids from tuple list?

I have following list:
List<(string Path, DepartmentDto Department)>
List<(string Path, DepartmentDto Department)>

All I want is call following method with departments ids as parameter:
await _subjectClient.GetByDepartmentIds();
await _subjectClient.GetByDepartmentIds();


I can do smth like this:
foreach(var department in departments)
{
    var id  = department.Department.Id;
    await _subjectClient.GetByDepartmentIds(id );
}
foreach(var department in departments)
{
    var id  = department.Department.Id;
    await _subjectClient.GetByDepartmentIds(id );
}

but it's not optimized
how to do better?
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

❔ Get list of indices from a List
C#CC# / help
3y ago
✅ How to return List from RestClient?
C#CC# / help
3y ago
How to use Tuple in generic class?
C#CC# / help
4y ago