public IEnumerable <BLModel.CarouselSetUp> GetCarouselNewsDetail(int OrganizationID) { IEnumerable <BLModel.CarouselSetUp> _carouselData = _carouselSetUpRepository.GetCarouselSetUpAll(OrganizationID).ToList(); foreach (var hp in _carouselData) { var _newsPh = _newsPhotoRepository.GetAll(hp1 => hp1.NewsID == hp.NewsID).OrderBy(_newsPhoto => _newsPhoto.NewsPhotoID).FirstOrDefault(); if (_newsPh != null) { hp.NewsPhotoUrl = _newsPh.NewsPhotos; } } return(_carouselData); }
public IEnumerable <DLModel.NewsPhoto> getAllNewsPhoto() { IEnumerable <DLModel.NewsPhoto> _newsPhoto = _newsPhotoRepository.GetAll().Select(newsPhoto => new DLModel.NewsPhoto().InjectFrom(newsPhoto)).Cast <DLModel.NewsPhoto>().OrderBy(newsPhoto => newsPhoto.NewsPhotoID).ToList(); return(_newsPhoto); }