Exemplo n.º 1
0
        private static void CreateCharacter(CharacterRepository repo)
        {
            Character newCharacter = UserIO.PromptUserForNewCharacter();

            newCharacter = repo.Create(newCharacter);

            UserIO.DisplayCharacter(repo.ReadById(newCharacter.Id));
        }
Exemplo n.º 2
0
        private static void UpdateCharacter(CharacterRepository repo, Character characterInfo)
        {
            string name = UserIO.PromptUser("Please Enter a name");

            characterInfo.Name = name;
            repo.Update(characterInfo.Id, characterInfo);
            Console.Clear();
            UserIO.DisplayCharacter(repo.ReadById(characterInfo.Id));
        }
Exemplo n.º 3
0
 private static void ReadCharacterById(CharacterRepository repo)
 {
     Character characterInfo = repo.ReadById(UserIO.PromptUserForInt("Enter Id"));
     if (characterInfo != null)
     {
         UserIO.DisplayCharacter(characterInfo);
         // Update Character
         UpdateCharacter(repo, characterInfo);
     }
 }