Although, technically, a method can have only one return type, the return type could be a tuple. As a result, starting with C# 7.0, it is possible to return multiple values packaged as a tuple using C# tuple syntax. For example, you could declare a GetName() method as
(string First, string Last) name = GetName();
static (string First, string Last) GetName()
{
string firstName, lastName;
firstName = GetUserInput(“Please enter first name”);
lastName = GetUserInput(“Please enter last name”);
return (firstName, lastName);
}
Please find the code in my github: https://github.com/pbndru/Tuples