public OrderDetailEditModels CreateOrderDetail(OrderDetailEditModels model, out string message)
        {
            var ship = _OrderDetailRepository.getOrderDetail(model.OrderId, model.ProductId);

            if (ship != null)
            {
                message = Constants.OrderDetailIsExist;
                return(null);
            }
            var CreateOrderDetail = _OrderDetailRepository.Insert(model.MapToEditEntity());

            UnitOfwork.SaveChanges();
            if (CreateOrderDetail == null)
            {
                message = Constants.CreateFail;
                return(null);
            }
            message = Constants.CreateSuccess;
            return(CreateOrderDetail.MapToEditModel());
        }
        public bool UpdateOrderDetail(OrderDetailEditModels model, out string message)
        {
            var OrderDetailEntity = _OrderDetailRepository.GetById(model.OrderId);

            if (OrderDetailEntity != null)
            {
                var gr = _OrderDetailRepository.getOrderDetail(model.OrderId, model.ProductId);
                if (gr != null)
                {
                    message = Constants.OrderDetailIsExist;
                    return(false);
                }
                OrderDetailEntity = model.MapToEditEntity(OrderDetailEntity);
                _OrderDetailRepository.Update(OrderDetailEntity);
                UnitOfwork.SaveChanges();
                message = Constants.UpdateSuccess;
                return(true);
            }
            message = Constants.UpdateFail;
            return(false);
        }