// POST api/<controller> public string Post([FromBody] Customer customer) { try { if (!string.IsNullOrEmpty(customer.Name)) { customer.Id = objcommon.GetMaxCustomerId(); objcommon.InsertCustomer(customer); return("customer Inserted Successfully."); } else { return("customer name required"); } } catch (Exception e) { return(e.Message.ToString()); } }