Files
yavsc/Yavsc/ViewModels/Account/Me.cs

25 lines
679 B
C#
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Linq;
namespace Yavsc.Models.Auth
{
public class Me {
public Me(ApplicationUser user)
{
id = user.Id;
givenName = user.UserName;
emails = new string [] { user.Email } ;
roles = user.Roles.Select(r=>r.RoleId).ToArray();
}
public string id { get; set; }
public string givenName { get; set; }
public string[] emails { get; set; }
public string[] roles { get; set; }
/// <summary>
/// Known as profile, could point to an avatar
/// </summary>
/// <returns></returns>
public string url { get; set; }
}
}