public async Task <RoleModel> GetAsync(int roleId) { if (roleId == 0) { throw new BadRequestException("Invalid Role Id"); } var model = await _repository.GetAsync(roleId); if (model == null) { throw new NotFoundException("Role not found"); } return(model); }
public async Task <ActionResult> Details(string id) { var model = await _rolesRepository.GetAsync(id); return(View(model)); }
public async Task <IActionResult> Get() { return(Ok(await _rolesRepository.GetAsync())); }