public IActionResult Post([FromBody] Customer customer)
        {
            var customerId = _businessController.AddCustomer(customer);

            return(CreatedAtRoute("GetCustomer", new { id = customerId }, customer));
        }
Example #2
0
 public bool AddCustomer(Customer newCustomer)
 {
     return(_businessController.AddCustomer(newCustomer));
 }
Example #3
0
 public void AddCustomer_ThrowsNullRefException_WhenCustomerIsNull()
 {
     var exception = Assert.Throws <NullReferenceException>(() => _businessController.AddCustomer(null));
 }