public IHttpActionResult GetBadge(long id) { var b = badgeSvc.GetBadge(id); if (b == null) { return(NotFound()); } return(Ok(BadgeDto.FromBadge(b))); }
public IActionResult Index() { List <User> users = _userService.GetUsers(25); //Chercher le contenu de l'objet badge de l'atribut ActiveBadge foreach (User user in users) { if (user.ActiveBadge != null) { Badge bb = _badgeService.GetBadge(user.ActiveBadge.Title.ToString()).First(); user.ActiveBadge = bb; } } ViewData["title"] = "Titre de la page"; return(View(users)); }
/// <summary> /// Get specific badge by unique id /// </summary> /// <param name="badgeId"></param> /// <returns></returns> public Badge GetBadge(Guid badgeId) { return(_badgeService.GetBadge(badgeId)); }