/// <summary> /// GetListProductNew /// </summary> /// <returns>GetProductNewResponse</returns> public async Task <GetProductIndexResponse> GetListProductIndex() { var response = new GetProductIndexResponse(); try { var resultProductNew = _dataAccess.GetListProductNew(); var resultProductSellMax = _dataAccess.GetListProductSellMax(); var resultProductInterest = _dataAccess.GetListProductInterestProcduct(); var resultProductPriceSale = _dataAccess.GetListProductPriceSale(); if (resultProductNew != null) { response.ListProductNew = MapList <GETPRODUCT_NEWS_Result, GetProductIndex>(resultProductNew.ToList()); response.Success = true; } if (resultProductSellMax != null) { response.ListProductSellMax = MapList <GETLISTPRODUCT_SELLMAX_Result, GetProductIndex>(resultProductSellMax.ToList()); response.Success = true; } if (resultProductInterest != null) { response.ListProductInterest = MapList <GETLISTPRODUCT_INTEREST_Result, GetProductIndex>(resultProductInterest.ToList()); response.Success = true; } if (resultProductPriceSale != null) { response.ListProductPriceSale = MapList <GETLISTPRODUCT_PRICESALE_Result, GetProductIndex>(resultProductPriceSale.ToList()); response.Success = true; } } catch (Exception ex) { response.Success = false; } return(await Task.FromResult(response)); }