Dot Net Core Middleware (Authorization + Custom Authorize)
1. AuthorizeHelper Class: 1. Add one helper class named AuthorizeHelper which contains GroupRoles static Dictionary, GroupRoles stored GroupId as key, and List of Roles against GroupId as Values. a. GroupRoles Dictionary contains RoleId, RoleName, GroupName, GroupId, and Dictionary will static means it will need to store Group Id with Roles Once for all User and if one User will store that GroupId and Roles then other access that GroupId and Roles with DB call. private static Dictionary<Int64, List<UsersGroup>> GroupRoles; public class UsersGroup { public Int64 RoleId { get; set; } public Int64 GroupId { get; set; } public string GroupName { get; set; } public string RoleName { get; set; } } 2. Add SetRoles Static Method which is First Filter Group Ids which already have in Dictionary and then call DB for getting Roles from list of Group Id...