/// <summary>
        /// Takes a LoginPlayerViewModel instance and returns a PlayerViewModel
        /// </summary>
        /// <returns></returns>
        public PlayerViewModel LoginPlayer(LoginPlayerViewModel loginPlayerViewModel)
        {
            Player player = new Player()
            {
                Fname = loginPlayerViewModel.Fname,
                Lname = loginPlayerViewModel.Lname
            };

            Player player1 = _repo.LoginPlayer(player);

            PlayerViewModel playerViewModel = _mapper.ConvertPlayerToPlayerViewModel(player1);

            return(playerViewModel);
        }
Exemple #2
0
        /// <summary>
        /// takes a LoginPlayerViewModel instance and returns a PlayerViewModel Instance
        /// </summary>
        /// <returns></returns>
        public PlayerViewModel LoginPlayer(LoginPlayerViewModel loginPlayerViewModel)
        {
            // have all logic confined to this Business layer.
            Player player = new Player()
            {
                Fname = loginPlayerViewModel.Fname,
                Lname = loginPlayerViewModel.Lname
            };

            Player player1 = _repository.LoginPlayer(player);

            //convert the Player to a PlayerViewModel
            PlayerViewModel playerViewModel = _mapperClass.ConvertPlayerToPlayerViewModel(player1);

            return(playerViewModel);
        }