Beispiel #1
0
        public async Task <HttpResponseMessage> CreateCustomer([FromBody] Customer value)
        {
            var response = new SingleModelResponse <Customer>() as ISingleModelResponse <Customer>;

            try
            {
                response.Model = await Task.Run(() => { return(BusinessObject.CreateCustomer(value)); });;

                response.Message = "The data was saved successfully!";
            }
            catch (Exception ex)
            {
                ExceptionHelper.Publish(ex);

                response.DidError     = true;
                response.ErrorMessage = ex.Message;
            }

            return(response.ToHttpResponse(Request));
        }