Exemplo n.º 1
0
        public bool Register(Trainer p_registerRequest)
        {
            try
            {
                var encrypted = BCEngine.Encrypt(p_registerRequest.Password);
                p_registerRequest.Password = encrypted;

                p_registerRequest.JoinedCompany = DateTime.Now;
                _trainerService.AddTrainer(p_registerRequest);
                p_registerRequest.Password = null;
                return(true);
            }
            catch (System.Exception ex)
            {
                throw new WebApiException(500, ex.Message);
            }
        }