コード例 #1
0
 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");
 }
コード例 #2
0
ファイル: Project.cs プロジェクト: dzondraa/ProjectManager
 public IActionResult Get([FromQuery] ProjectSearch search, [FromServices] IQueryProject query)
 {
     return(Ok(_executor.ExecuteQuery(query, search)));
 }