public FileUploadValidator(IQueryProject queryProject) { _queryProject = queryProject; RuleFor(x => x.ProjectName) .Must(p => _queryProject.Execute(new Api.Searches.ProjectSearch { Name = p }).TotalCount > 0) .WithMessage($"Could not reference the project with that name"); RuleFor(x => x.Path) .Must(p => p.Split(".").Last() == "zip") .WithMessage("Only zip archives are supported"); }
public IActionResult Get([FromQuery] ProjectSearch search, [FromServices] IQueryProject query) { return(Ok(_executor.ExecuteQuery(query, search))); }