示例#1
0
        public IHttpActionResult GetByID()
        {
            IndividualPokemonService individualPokemonService = CreateIndividualPokemonService();
            var individualPokemon = individualPokemonService.GetIndividualPokemonByID();

            return(Ok(individualPokemon));
        }
示例#2
0
        private IndividualPokemonService CreateIndividualPokemonServiceWithUserAccountID(int id)
        {
            //this line associates the auto-generated Application user id with the account that we want
            var accountWeWant = id; //for the sake of clarity

            //This is the new instance of UserService
            var userService = new UserService();

            //this is a getting method for the application UserID
            string applicationUserID = User.Identity.GetUserId();//Returns Username

            //This is establishing the ApplicationUser account and connecting it to "accountWeWant" variable
            User user = userService.GetUserAccountByID(applicationUserID, accountWeWant);

            //This is the final step to then  connect our established User/Trainer account with the Application User account
            var pokeService = new IndividualPokemonService(user.UserID);

            return(pokeService);
        }
示例#3
0
        private IndividualPokemonService CreateIndividualPokemonService()
        {
            var moveService = new IndividualPokemonService();

            return(moveService);
        }