using CustomerService; public async TaskAddCustomer(Customer customer) { ICustomerService customerService = new CustomerService(); var result = await customerService.AddCustomerAsync(customer); if(result == true) { return Ok(); } else { return NotFound(); } }
using CustomerService; public async TaskThis code snippet shows how to use the AddCustomerAsync method to add a new customer to the customer service system and return a boolean value indicating whether the operation was successful or not.AddCustomer(Customer customer) { ICustomerService customerService = new CustomerService(); var result = await customerService.AddCustomerAsync(customer); return result; }