コード例 #1
0
        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
コード例 #2
0
        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