public IHttpActionResult PostClient(NewClient newClient) { if (!ModelState.IsValid) return BadRequest(ModelState); Client client = repo_.AddNewClient(newClient); client = repo_.AddClientNote(client.Id, NewNote.ClientCreated()); if (!String.IsNullOrWhiteSpace(newClient.Referrer)) client = repo_.AddClientNote(client.Id, new NewNote("Referred by " + newClient.Referrer)); return Ok(client); } // PostClient
public IHttpActionResult PostClient(NewClient newClient) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } Client client = repo_.AddNewClient(newClient); client = repo_.AddClientNote(client.Id, NewNote.ClientCreated()); return(Ok(client)); } // PostClient