public async Task<ActionResult> Edit(string emailAddress) { AccountModel model; B2CGraphClient b2CGraphClient = new B2CGraphClient(_tenant, _clientId, _clientSecret); GraphAccountModel user = await b2CGraphClient.GetUser(emailAddress); if (user != null) { model = new AccountModel() { signInName = user.signInNames[0].value, displayName = user.displayName, firstName = user.givenName, lastName = user.surname, extension_jdrfConsId = user.extension_jdrfConsId }; } else { return RedirectToAction("Find"); } return View(model); }