Exemplo n.º 1
0
        public Response AddToCollection(int playerId)
        {
            var(created, errors) = playerService.AddPlayerToCollection(playerId, User.Id);

            if (!created && errors == null)
            {
                return(Redirect("/Players/All"));
            }

            if (!created)
            {
                return(View(new { ErrorMessage = errors }, "/Error"));
            }

            return(Redirect("/Players/All"));
        }