public IList <Image> GetImages(SearchImageModel searchImageModel) { if (!searchImageModel.Validate()) { throw new ArgumentException("SearchImageModel didn't pass validation"); } return(_context.Query <Image>($@" SELECT ImageId ,ImageName ,ImagePath FROM Images {CreateQuery(searchImageModel)} ORDER BY {searchImageModel.OrderBy}{(searchImageModel.IsDesc ? " DESC" : string.Empty)} OFFSET @skip ROWS FETCH NEXT @take ROWS ONLY ", new { skip = searchImageModel.Skip, take = searchImageModel.Take } ).ToList()); }
public ToDownloadListViewModel() { searchModel = new SearchImageModel(Environment.CurrentDirectory + "/cache"); searchModel.CollectionChanged += OnCollectionChanged; imageProcessModel = new ImageProcessModel(Environment.CurrentDirectory + "/processcache"); imageProcessModel.OnProcessedImageChange += () => { OnPropertyChanged(new PropertyChangedEventArgs(nameof(ProcessedImage))); }; outputdDirectory = System.IO.Path.Combine(Environment.CurrentDirectory, "out"); }
public ActionResult ShowPager(SearchImageModel searchImage) { searchImage.Count = _imageRepository.Count(searchImage); return(PartialView("_Pager", searchImage)); }
public ActionResult PagesData(SearchImageModel searchImage) { return(PartialView("ImagesData", _imageRepository.GetImages(searchImage))); }