示例#1
0
        public IHttpActionResult GetBadge(long id)
        {
            var b = badgeSvc.GetBadge(id);

            if (b == null)
            {
                return(NotFound());
            }
            return(Ok(BadgeDto.FromBadge(b)));
        }
示例#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));
        }
示例#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));
 }