Esempio n. 1
0
        public IHttpActionResult GetCharacter(int id)
        {
            var character = _rules.GetCharacter(id);

            if (null == character)
            {
                return(NotFound());
            }

            return(Ok(PrepareCharacterViewModel(character)));
        }
        // GET: CharacterSheets/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var character = _rules.GetCharacter(id.Value);

            if (character == null)
            {
                return(HttpNotFound());
            }

            var viewModel = new ViewEditCharacterViewModel
            {
                IsEditing = false,
                Character = PrepareCharacterViewModel(character)
            };

            return(View(viewModel));
        }