Ejemplo n.º 1
0
        public IHttpActionResult GetBadge(long id)
        {
            var b = badgeSvc.GetBadge(id);

            if (b == null)
            {
                return(NotFound());
            }
            return(Ok(BadgeDto.FromBadge(b)));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Get specific badge by unique id
 /// </summary>
 /// <param name="badgeId"></param>
 /// <returns></returns>
 public Badge GetBadge(Guid badgeId)
 {
     return(_badgeService.GetBadge(badgeId));
 }