Example #1
0
        public ActionResult RegisterUser(RegisterCustomer newCustomer)
        {
            bool UsernameExists = _repository.CheckIfUsernameExists(newCustomer.UserName);

            if (!UsernameExists)
            {
                var registrationInfo = _repository.RegisterCustomer(newCustomer);

                return(Created($"/api/user/{registrationInfo.Id}", registrationInfo));
            }
            else
            {
                return(Conflict("This Username already exists"));
            }
        }