public IActionResult Put(string id, [FromBody] CustomerContactInfoDTO modifiedCustomer) { try { using (NorthwindContext dbContext = new()) { CustomerSC.UpdateCustomer(dbContext, id, modifiedCustomer); } return(Ok()); } catch (Exception ex) { return(InternalServerError(ex)); } }
public IActionResult Post([FromBody] CustomerContactInfoDTO newCustomer) { string id; try { using (NorthwindContext dbContext = new()) { id = CustomerSC.AddNewCustomer(dbContext, newCustomer); } return(Ok("Registered Id: " + id)); } catch (Exception ex) { return(InternalServerError(ex)); } }