public async Task <ProductWithRateSearchRes> GetProductWithRateBySearchCriteria([FromBody] ProductWithRateSearchReq request) { var response = new ProductWithRateSearchRes(); try { if (request != null) { //var result1 = await _productRepository.GetProductDetailsBySearchCriteriaOldNotInUse(request); var result = await _productRepository.GetProductWithRateBySearchCriteria(request); if (result != null && result.Count > 0) { response.ResponseStatus.Status = "Success"; response.ProductWithRate = result.ToList(); } else { response.ResponseStatus.Status = "Success"; response.ResponseStatus.ErrorMessage = "No Records Found."; } } else { response.ResponseStatus.Status = "Failure"; response.ResponseStatus.ErrorMessage = "Product details can not be blank."; } } catch (Exception ex) { response.ResponseStatus.Status = "Failure"; response.ResponseStatus.ErrorMessage = "An error occurs " + ex.Message; } return(response); }
public async Task <ProductWithRateSearchRes> GetProductWithRateBySearchCriteria(ProductWithRateSearchReq productSearchReq, string ticket) { ProductWithRateSearchRes productSearchRes = new ProductWithRateSearchRes(); productSearchRes = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceMaster:ServiceGetProductWithRateBySearchCriteria"), productSearchReq, typeof(ProductWithRateSearchRes), ticket); return(productSearchRes); }