private List <Product_DTO> Get_Products_ByGroupId(int?Product_Group_ID) { var request = new Get_Products_By_GroupId_Request { Product_Group_ID = Product_Group_ID ?? 0, Page = new Page(0, int.MaxValue), Publish = (int)ACTIVE.ALL }; var data = this._IProductService.Get_Products_By_GroupId(request)?.Results; if (data != null) { foreach (var item in data) { var getImgRequest = new Get_Images_By_RelateId_Request { Page = new Entity.Page(0, int.MaxValue), RelateId = item.Product_ID.ToString(), Type = "PRODUCT" }; var listImg = this._IImagesService.Get_Images_By_RelateId(getImgRequest)?.Results; item.ListImage = new List <Images_DTO>(); item.ListImage = listImg; } } return(data); }
public Get_Images_By_RelateId_Response Get_Images_By_RelateId(Get_Images_By_RelateId_Request request) { var response = _IImagesRepository.GetPage(request.Page, p => p.RelateId == request.RelateId && p.Type == request.Type, p => p.Id); var retData = Mapper.Map <ResponseBase <List <Images> >, Get_Images_By_RelateId_Response>(response); return(retData); }
private List <Images_DTO> Get_ListImage_By_Product_GroupId(string product_GroupId) { var request = new Get_Images_By_RelateId_Request() { Page = new Page(0, 100), RelateId = product_GroupId }; return(this._IImagesService.Get_Images_By_RelateId(request)?.Results); }