public HttpResponseMessage Createwarehouse(Warehouse warehouse_requests) { WarehouseManager warehouseManager = new WarehouseManager(); cls_common_responses clsCommonResponses1 = new cls_common_responses(); if (warehouse_requests == null) { clsCommonResponses1.ResponseCode = 400; clsCommonResponses1.ResponseMessage = ""; return(this.Request.CreateResponse <cls_common_responses>(HttpStatusCode.OK, clsCommonResponses1)); } HttpResponseMessage response; try { warehouse_requests.CreatedBy = new int?(1); warehouse_requests.CreatedDate = new DateTime?(DateTime.Now); warehouse_requests.UpdatedBy = new int?(1); warehouse_requests.UpdatedDate = new DateTime?(DateTime.Now); cls_common_responses clsCommonResponses2 = warehouseManager.Createwarehouse("Proc_Warehouse_Save", warehouse_requests); int responseCode = clsCommonResponses2.ResponseCode; response = this.Request.CreateResponse <cls_common_responses>(HttpStatusCode.OK, clsCommonResponses2); } catch (Exception ex) { clsCommonResponses1.ResponseCode = 400; clsCommonResponses1.ResponseMessage = "Something went wrong, please try again later."; response = this.Request.CreateResponse <cls_common_responses>(HttpStatusCode.OK, clsCommonResponses1); } return(response); }