Example #1
0
        public Client AddUser(AddUserRequest iur)
        {
            try
            {
                var cl = new Client
                {
                    FirstName   = iur.FirstName,
                    LastName    = iur.LastName,
                    Email       = iur.Email,
                    Phone       = iur.Phone,
                    Login       = iur.Login,
                    Hash        = AuthHandler.Create(iur.Password, AuthHandler.CreateSalt()),
                    TokenString = "xxx"
                };


                _advertContext.SaveChanges();


                return(cl);
            }
            catch (SqlException ex)
            {
                return(null);
            }
        }