예제 #1
0
        public IActionResult CharacterView(int characterId)
        {
            var character = Mapper.Map <CharacterViewModel>(charactersRepository.GetCharacterById(characterId));

            character.Images = charactersRepository.GetImagesByCharacterId(characterId).Select(i => Mapper.Map <ImageViewModel>(i)).ToList();

            HttpContext.Session.SetComplexData("NewRelationships", character.Relationships);

            ViewData["Characters"]       = charactersRepository.GetAllCharacters().ToDictionary(ch => ch.Id, ch => ch.Name + " " + ch.Surname);
            ViewData["TypeOfCharacters"] = charactersRepository.GetTypesOfCharacter().ToDictionary(b => b.Id, b => b.Name);;
            ViewData["Orientations"]     = charactersRepository.GetOrientations().ToDictionary(b => b.Id, b => b.Name);;
            ViewData["AlignmentCharts"]  = charactersRepository.GetAlignmentChatrs().ToDictionary(b => b.Id, b => b.Name);
            ViewData["Breeds"]           = charactersRepository.GetAllBreeds().ToDictionary(b => b.Id, b => b.Name);
            ViewData["DisableEditing"]   = "true";

            return(View("~/Views/Character/CharacterView.cshtml", character));
        }