public IActionResult Register([FromBody] RegisterModel sellerDto)
        {
            sellerDto.userName = sellerDto.userName.ToLower();

            try
            {
                // save
                var seller = new Seller()
                {
                    firstName = sellerDto.firstName,
                    lastName  = sellerDto.lastName,
                    userName  = sellerDto.userName,
                    sex       = sellerDto.sex,
                    age       = sellerDto.age,
                    adminId   = sellerDto.adminId
                };
                _sellerService.Create(seller, sellerDto.password);
                return(Ok());
            }
            catch (AppException ex)
            {
                // return error message if there was an exception
                return(BadRequest(new { message = ex.Message }));
            }
        }
        public Seller Create(User user)
        {
            Seller newSeller = new Seller()
            {
                UserId = user.UserId
            };

            _service.Create(newSeller);

            return(newSeller);
        }
Example #3
0
 public int Create(SellerCreate model)
 {
     return(sellerService.Create(model));
 }