This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Get role assignments | |
| var oid = context.Principal.FindFirstValue("http://schemas.microsoft.com/identity/claims/objectidentifier"); | |
| var roleData = dbContext.RoleMaps.Where(w => w.ObjectId == oid).Join(dbContext.Roles, map => map.RoleId, | |
| role => role.Id, (map, role) => new {RoleName = role.Name}).ToList(); | |
| // Assign roles to claims, loop for multiple roles | |
| if (roleData.Count != 0) | |
| { | |
| List<Claim> claims = new List<Claim>(); | |
| foreach (var role in roleData) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace GitHub.Gist | |
| { | |
| public class SampleClass | |
| { | |
| public List<SelectListItem> Timezones { get; } = new List<SelectListItem>(TimeZoneInfo.GetSystemTimeZones().Select(tz => new SelectListItem() | |
| { | |
| Text = tz.DisplayName, | |
| Value = tz.Id | |
| }).ToList()); | |
| } |
NewerOlder