I have the following method which returns a tuple,
public Tuple<int, bool> GetStudentInformation(long stutID)
Marks= GetStudentInformation((Id).Item1; HasPassed= GetStudentInformation((Id).Item2;
This works fine as it is but I dont like that I call the same method twice to get item1 and item2, using Tuple is probably not the way ahead but any advice if c# has support to get two values returned over a single execution of the method?
You just need to save return value
Tuple<int, bool> info = GetStudentInformation(Id); Marks = info.Item1; HasPassed = info.Item2;