public virtual async Task <JsonResult> Relegate() { var user = await _userAppService.GetMeAsync(); switch (user.Type) { case UserType.Member: await _userTypeAppService.RetireAsync(); break; case UserType.TeamLeader: await _userTypeAppService.ResignationAsync(); break; default: throw new UserFriendlyException("the user does not support the operation"); } return(Json(new AjaxResponse())); }