public void Delete(Role Role)
 {
     if (Role.RoleName != null && Role.Description != null)
     {
         _context.Delete(Role);
     }
 }
        public ActionResult UpdateRole(Role role)
        {
            if (role != null && ModelState.IsValid)
            {
                _rolesService.Update(role);
                return Json(1);
            }

            return Json(-1);
        }
        public async Task<ActionResult> CreateRole(Role role)
        {
            if (ModelState.IsValid)
            {
                var identityRole = new IdentityRole(role.RoleName);
                var roleresult = await RoleManager.CreateAsync(identityRole);
                if (!roleresult.Succeeded)
                {
                    ModelState.AddModelError("", roleresult.Errors.First());
                    return Json(-1);
                }
                return Json(_rolesService.Add(role));
            }

            return Json(-1);
        }
 public int Add(Role Role)
 {
     _context.Add(Role);
     return Role.RoleId;
 }