public Customer Create([FromBody] CreateCustomerParameters customerParameters) { return(customerRepository.CreateCustomer( customerParameters.Email, customerParameters.PasswordHash, customerParameters.FirstName, customerParameters.LastName, customerParameters.Age)); }
public async Task <ActionResult> NewCustomerAction([SingleParameterBinder(typeof(CreateCustomerParameters))] CreateCustomerParameters createCustomerParameters) { if (createCustomerParameters == null) { return(this.Problem(ProblemJsonBuilder.CreateBadParameters())); } var createdCustomer = await customersRoot.CreateCustomerAction.Execute(createCustomerParameters); // Will create a Location header with a URI to the result. return(this.Created(new HypermediaCustomer(createdCustomer))); }
public async Task <ActionResult> NewCustomerAction(CreateCustomerParameters createCustomerParameters) { if (createCustomerParameters == null) { return(this.Problem(ProblemJsonBuilder.CreateBadParameters())); } var createdCustomer = await customersRoot.CreateCustomer.ExecuteAsync(createCustomerParameters).ConfigureAwait(false); // Will create a Location header with a URI to the result. return(this.Created(createdCustomer)); }
public Customer Update(Guid id, [FromBody] CreateCustomerParameters newParameters) { //TODO return(new Customer()); }