public async Task <ActionResult <RankDTO> > GetAsync(int id) { try { return(Ok(await rankService.GetAsync(new RankDTO { Id = id }))); } catch (NotFoundException e) { return(NotFound(new { Id = id, e.Message })); throw; } }
// GET: Ranks/Edit/5 public async Task <IActionResult> Edit(string id) { var result = await _rankService.GetAsync(id); return(View(result)); }
public async Task <Rank> GetRankByUserId(String userId) { var userRank = _UserRank.Find <UserRank>(o => o.UserId == userId).FirstOrDefault(); return(await _ranksService.GetAsync(userRank.RankId)); }