Exemplo n.º 1
0
        public async Task <IActionResult> ArchiveDepartment(int departmentMasterId)
        {
            #region Authorization code
            var    identity = HttpContext.User.Identity as ClaimsIdentity;
            string id       = "";
            string role     = "";
            if (identity != null)
            {
                IEnumerable <Claim> claims = identity.Claims;
                // or
                id   = identity.Claims.Where(m => m.Type == ClaimTypes.Sid).Select(m => m.Value).FirstOrDefault();
                role = identity.Claims.Where(m => m.Type == ClaimTypes.Role).Select(m => m.Value).FirstOrDefault();
            }
            long userId = Convert.ToInt32(id);
            #endregion
            //calling DepartmentDAL busines layer
            CommonResponse response = new CommonResponse();
            response = departmentMaster.ArchiveDepartment(departmentMasterId, userId);

            return(Ok(response));
        }