public IViewComponentResult Invoke() { var model = new List <PhotoGalleryModel>(); var galleryList = _galleryService.GetGalleryMappingList().Where(x => x.Gallery.Name != "InstagtamGaleri"); foreach (var gallery in galleryList) { model.Add(_galleryFactory.PreParePhotoGalleryModel(new PhotoGalleryModel(), gallery)); } return(View(model)); }
public List <PhotoGalleryModel> PreParePhotoGalleryListModel(int photoGallery) { if (photoGallery == 0) { return(new List <PhotoGalleryModel>()); } var query = _galleryService.GetGalleryMappingList(photoGallery); var model = new List <PhotoGalleryModel>(); foreach (var photoGalleryMapping in query) { model.Add(PreParePhotoGalleryModel(new PhotoGalleryModel(), photoGalleryMapping)); } return(model); }