C#C
C#3y ago
SWEETPONY

✅ How to get ids from tuple list?

I have following list: List<(string Path, DepartmentDto Department)>
All I want is call following method with departments ids as parameter:
await _subjectClient.GetByDepartmentIds();

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

but it's not optimized
how to do better?
Was this page helpful?