public async Task <bool> ValidateId(ImageFile ImageFile) { ImageFileFilter ImageFileFilter = new ImageFileFilter { Skip = 0, Take = 10, Id = new LongFilter { Equal = ImageFile.Id }, Selects = ImageFileSelect.Id }; int count = await UOW.ImageFileRepository.Count(ImageFileFilter); if (count == 0) { ImageFile.AddError(nameof(ImageFileValidator), nameof(ImageFile.Id), ErrorCode.IdNotExisted); } return(count == 1); }