diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/ShowProfile.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/ShowProfile.razor
index 49e2027a8e..1674332f7a 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/ShowProfile.razor
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/ShowProfile.razor
@@ -24,61 +24,21 @@ else
Name |
@user.DisplayName |
-
- | Photo |
-
- @{
- if (photo != null)
- {
-
- }
- else
- {
- NO PHOTO
- Check user profile in Azure Active Directory to add a photo.
- }
- }
- |
-
}
@code {
User user;
- string photo;
protected override async Task OnInitializedAsync()
{
try
{
user = await GraphServiceClient.Me.Request().GetAsync();
- photo = await GetPhoto();
}
catch (Exception ex)
{
ConsentHandler.HandleException(ex);
}
}
-
- protected async Task GetPhoto()
- {
- string photo;
-
- try
- {
- using (var photoStream = await GraphServiceClient.Me.Photo.Content.Request().GetAsync())
- {
- byte[] photoByte = ((System.IO.MemoryStream)photoStream).ToArray();
- photo = Convert.ToBase64String(photoByte);
- this.StateHasChanged();
- }
-
- }
- catch (Exception)
- {
- photo = null;
- }
- return photo;
- }
-
}