If the method is on the same controller, it will already have access to the same request. You don't need to pass anything to the other method.
Since you're using an
async
method, you will need to
await
the other method:
public async Task<IActionResult> Index()
{
return await validateRequest();
}
public async Task<IActionResult> validateRequest()
{
var myRequest = new myRequest(Request);
return View("validatedRequest");
}
Or, if the
return await ...
statement is the only
await
statement in the calling method, you can remove the
async
modifier from and return the other method's
Task
directly:
public Task<IActionResult> Index()
{
return validateRequest();
}