Start Async function

1

Good morning, I do not have much knowledge about async, and maybe someone could help me regarding this:

public async Task<ActionResult> IndexAsync(CancellationToken cancellationToken)
    {
        var result = await new AuthorizationCodeMvcApp(this, new AppFlowMetadata()).
            AuthorizeAsync(cancellationToken);

        if (result.Credential != null)
        {
            ViewBag.Message = result.Credential.UserId;
            DriveService service = new DriveService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = result.Credential,
                ApplicationName = "Drive API",
            });
            return View();
        }
        else
        {
            return new RedirectResult(result.RedirectUri);
        }
    }

I needed a way to call this function, but I do not know how I would do it, if anyone can help me. Obs: It's inside a controller.

    
asked by anonymous 03.04.2017 / 15:31

0 answers