//[Route("GetAllCategory")]

        public async Task <IActionResult> GetAllUnitOfMeasure([FromBody] SearchUnitOfMeasureViewModel viewModel)
        {
            if (viewModel.PageIndex == -1 || viewModel.PageSize == -1)
            {
                return(this.ApiResponse <string>(null, $"{viewModel.PageIndex} or {viewModel.PageSize} can not be -1", ApiResponseCodes.INVALID_REQUEST));
            }

            var result = await _unitOfMeasureService.GetAllUnitOfMeasure(viewModel);

            if ((result.Code != ApiResponseCodes.OK))
            {
                return(base.ApiResponse <string>(null, result.Description,
                                                 ApiResponseCodes.EXCEPTION, 1));
            }
            if (result.Payload == null)
            {
                return(this.ApiResponse <List <UnitOfMeasureListViewModel> >(result.Payload, "Record not Found.", ApiResponseCodes.NOT_FOUND));
            }
            return(this.ApiResponse <List <UnitOfMeasureListViewModel> >(result.Payload, "successful.", ApiResponseCodes.OK));
        }