public IActionResult CreateOrderDetail([FromBody] OrderFormModel orderdata) { BookingModel bookingModel = new BookingModel(); Consignee consignee = new Consignee(); Shipper shipper = new Shipper(); if (ModelState.IsValid) { Guid bookingobj = Guid.NewGuid(); Guid consigneeobj = Guid.NewGuid(); Guid shipperobj = Guid.NewGuid(); bookingModel.BookingId = bookingobj; consignee.ConsigneeId = consigneeobj; shipper.ShipperId = shipperobj; shipper.Name = orderdata.ShipperName; shipper.Address1 = orderdata.ShipperAddress1; shipper.Address2 = orderdata.ShipperAddress2; shipper.Contact1 = orderdata.ShipperContactNo; shipper.Email = orderdata.ShipperEmail; consignee.Name = orderdata.ConsigneeName; consignee.Address1 = orderdata.ConsigneeAddress1; consignee.Address2 = orderdata.ConsigneeAddress2; consignee.ContactNumber = orderdata.ConsigneeContactNo; consignee.Email = orderdata.ConsigneeEmail; bookingModel.CreatedDate = DateTime.Now; bookingModel.UpdatedDate = DateTime.Now; consignee.CreatedDate = DateTime.Now; consignee.UpdatedDate = DateTime.Now; shipper.CreatedDate = DateTime.Now; shipper.UpdatedDate = DateTime.Now; bookingModel.ClientId = orderdata.ClientId; bookingModel.CreatedBy = "User"; consignee.CreatedBy = "User"; shipper.CreatedBy = "User"; bookingModel.Consignee = consignee; bookingModel.Shipper = shipper; _dataAccessProvider.AddOrderDetails(bookingModel.Consignee, bookingModel.Shipper, bookingModel); SendOrderToWMSModel sendOrderToWMS = new SendOrderToWMSModel(); sendOrderToWMS = _dataAccessProvider.SendOrderDataToWMS(orderdata, bookingobj); return(Ok(sendOrderToWMS)); } return(BadRequest(ModelState)); }