diff --git a/WebAppGraphAPI/Models/UserProfile.cs b/WebAppGraphAPI/Models/UserProfile.cs index dffbe0e..479ff48 100644 --- a/WebAppGraphAPI/Models/UserProfile.cs +++ b/WebAppGraphAPI/Models/UserProfile.cs @@ -6,9 +6,38 @@ using System.Web; namespace WebAppGraphAPI.Models { public class UserProfile - { - public string DisplayName { get; set; } - public string GivenName { get; set; } - public string Surname { get; set; } + { + public string ObjectType { get; set; } + public List AssignedLicenses { get; set; } + public List AssignedPlans { get; set; } + public object City { get; set; } + public object Country { get; set; } + public object Department { get; set; } + public object DirSyncEnabled { get; set; } + public string DisplayName { get; set; } + public object FacsimileTelephoneNumber { get; set; } + public string GivenName { get; set; } + public object ImmutableId { get; set; } + public object JobTitle { get; set; } + public object LastDirSyncTime { get; set; } + public object Mail { get; set; } + public string MailNickname { get; set; } + public object Mobile { get; set; } + public List OtherMails { get; set; } + public string PasswordPolicies { get; set; } + public object PasswordProfile { get; set; } + public object PhysicalDeliveryOfficeName { get; set; } + public object PostalCode { get; set; } + public object PreferredLanguage { get; set; } + public List ProvisionedPlans { get; set; } + public List ProvisioningErrors { get; set; } + public List ProxyAddresses { get; set; } + public object State { get; set; } + public object StreetAddress { get; set; } + public string Surname { get; set; } + public object TelephoneNumber { get; set; } + public object UsageLocation { get; set; } + public string UserPrincipalName { get; set; } + public string UserType { get; set; } } } \ No newline at end of file diff --git a/WebAppGraphAPI/Views/UserProfile/Index.cshtml b/WebAppGraphAPI/Views/UserProfile/Index.cshtml index b630e48..027765b 100644 --- a/WebAppGraphAPI/Views/UserProfile/Index.cshtml +++ b/WebAppGraphAPI/Views/UserProfile/Index.cshtml @@ -1,32 +1,52 @@ -@model WebAppGraphAPI.Models.UserProfile -@{ - ViewBag.Title = "User Profile"; -} - -

@ViewBag.Title.

- - - - - - - - - - - - - - -
Display Name@Model.DisplayName
First Name@Model.GivenName
Last Name@Model.Surname
- -@if (ViewBag.ErrorMessage == "AuthorizationRequired") -{ -

You have to sign-in to see your profile. Click @Html.ActionLink("here", "Index", "UserProfile", new { reauth = true }, null) to sign-in.

-} - -@if (ViewBag.ErrorMessage == "UnexpectedError") -{ -

An unexpected error occurred while retrieving your profile. Please try again. You may need to sign-in.

-} - +@using System.Collections +@model WebAppGraphAPI.Models.UserProfile +@{ + ViewBag.Title = "User Profile"; +} +

@ViewBag.Title.

+ + + @{ + var type = Model.GetType(); + var properties = type.GetProperties(); + var collections = new List() { typeof(IEnumerable<>), typeof(IEnumerable) }; + + foreach (var property in properties) + { + + + + + + } + + } +
@property.Name + @{ + if (property.PropertyType != typeof(string) && property.PropertyType.GetInterfaces().Any(i => collections.Any(c => i == c))) + { + var list = (IList)property.GetValue(Model, null); + if (list != null) + { + foreach (var value in list) + { + @value
+ } + } + + } + else + { + @property.GetValue(Model, null) + } + } +
+ +@if (ViewBag.ErrorMessage == "AuthorizationRequired") +{ +

You have to sign-in to see your profile. Click @Html.ActionLink("here", "Index", "UserProfile", new { reauth = true }, null) to sign-in.

+} +@if (ViewBag.ErrorMessage == "UnexpectedError") +{ +

An unexpected error occurred while retrieving your profile. Please try again. You may need to sign-in.

+}