private async Task OnInitialize() { userProfile = await IdentityService.GetUserProfileAsync(); if (!string.IsNullOrEmpty(Id)) { if (Guid.TryParse(Id, out var id)) { try { manager = Mapper.Map <UpdateManagerProfile>(await ManagersClient.GetManagerAsync(id)); if (manager.Address == null) { manager.Address = new Address(); } } /* catch (ApiException exc) * { * } * catch (HttpRequestException exc) * { * } */ catch (Exception exc) { await JSHelpers.Alert(exc.Message); } } else { // Handle expected guid } } else { manager = new AddManagerProfile() { Address = new Address() }; } try { organizations = await OrganizationsClient.GetOrganizationsAsync(); } /* catch (ApiException exc) * { * } * catch (HttpRequestException exc) * { * } */ catch (Exception exc) { await JSHelpers.Alert(exc.Message); } }