Exemple #1
0
        public async Task <IHttpActionResult> UpdateAsync(CustomerContract customer)
        {
            try
            {
                await customerService.UpdateAsync(customer.ToModel());

                return(Content(HttpStatusCode.Accepted, customer.CustomerId));
            }
            catch (KeyNotFoundException)
            {
                return(NotFound());
            }
        }
Exemple #2
0
        public async Task <IHttpActionResult> AddAsync(CustomerContract customer)
        {
            await customerService.AddAsync(customer.ToModel());

            return(Created(new Uri(Request.RequestUri, customer.CustomerId.ToString()), customer.CustomerId));
        }