using System.Collections.Generic; using System.Linq; using System.Security.Claims; namespace Icarus.Models.Shared { public class User { public string Username { get; set; } public string Password { get; set; } public IEnumerable Roles { get; set; } public IEnumerable Claims() { var claims = new List { new Claim(ClaimTypes.Name, Username) }; claims.AddRange(Roles.Select(role => new Claim(ClaimTypes.Role, role))); return claims; } } }