Make Me dependentless of any ApplicationUser
This commit is contained in:
@ -1,24 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Yavsc.Models.Auth
|
||||
{
|
||||
public class Me {
|
||||
public Me(ApplicationUser user)
|
||||
public Me(string useruserid,
|
||||
string username,
|
||||
IEnumerable<string> emails,
|
||||
IEnumerable<string> roles,
|
||||
string avatar)
|
||||
{
|
||||
id = user.Id;
|
||||
givenName = user.UserName;
|
||||
emails = new string [] { user.Email } ;
|
||||
roles = user.Roles.Select(r=>r.RoleId).ToArray();
|
||||
Id = useruserid;
|
||||
UserName = username;
|
||||
EMails = emails.ToArray();
|
||||
Roles = roles.ToArray();
|
||||
Avatar = avatar;
|
||||
}
|
||||
public string id { get; set; }
|
||||
public string givenName { get; set; }
|
||||
public string[] emails { get; set; }
|
||||
public string[] roles { get; set; }
|
||||
public string Id { get; set; }
|
||||
public string UserName { 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; }
|
||||
public string Avatar { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user