C# - How to return a named tuple from a method

You are probably here because you have forgotten the syntax for returning a tuple from a method. To be honest that is also the reason why this post was written, the author forgot it too! The syntax for returning a tuple is the following:

public (string Name, string Lastname) MethodName()
{
    return ("Peter", "Rasmussen");
}

If you want to wrap this in a task it looks like the following:

public async Task<(string Name, string Lastname)> MethodName(){
    return await Task.FromResult(("Peter", "Rasmussen"));
}

That is all there is to it. In most IDEs you can have the method return type auto generated if you just write something similar to: return ("Peter", "Rasmussen");.