C# - How to return a Task with a named tuple as a result

So you are likely here because you cannot remember the syntax for returning a task with a named tuple, in short you are likely just looking for the below:

public async Task<(string Name, string Lastname)> MethodName(){

If you want an example of how this works with a return statement there is an example below. The Task.FromResult is just to create an already completed task with a result:

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

[Fact]
public async Task Test()
{
    var person = await MethodName();
    Assert.Equal("Peter", person.Name);
    Assert.Equal("Rasmussen", person.Lastname);
}

I hope you found this helpful, let me know in the comments below! :)