public string GetProducts(GetProducts_Request request)
        {
            var    response = GetProducts_Data(request);
            string json     = JsonConvert.SerializeObject(response);

            return(json);
        }
        private ResponseBase <List <GetProducts_DataMaper> > GetProducts_Data()
        {
            var request     = new GetProducts_Request();
            var response    = _IProductService.GetProducts(request);
            var dataMapping = Mapper.Map <ResponseBase <List <PRODUCT> >, ResponseBase <List <GetProducts_DataMaper> > >(response);

            return(dataMapping);
        }
Example #3
0
        public Get_Products_Response GetProducts(GetProducts_Request request)
        {
            var products = _IProductRepository.Get_Products(request.Page);

            var retData = Mapper.Map <ResponseBase <List <PRODUCT> >, Get_Products_Response>(products);

            if (retData != null && retData.Results != null)
            {
                retData.StatusCode = (int)RESULT_STATUS_CODE.SUCCESS;
            }
            else
            {
                retData.StatusCode = (int)RESULT_STATUS_CODE.NODATA;
            }
            return(retData);
        }
        /* ========================================================== Get ==================================================================================*/

        private Get_Products_Response GetProducts_Data(GetProducts_Request request)
        {
            var response = _IProductService.GetProducts(request);

            return(response);
        }
        public ResponseBase <List <PRODUCT> > GetProducts(GetProducts_Request request)
        {
            var response = _IProductRepository.GetAll(request.Page, x => x.Product_ID, false);

            return(response);
        }