コード例 #1
0
 public EditProjectResponse EditProject(EditProjectRequest request)
 {
     using (var tran = transactionCreator.GetTransaction())
     {
         var output = wrapped.EditProject(request);
         tran.Commit();
         return(output);
     }
 }
コード例 #2
0
        public EditProjectResponse EditProject(EditProjectRequest request)
        {
            var validator = validatorFactory.GetValidator();
            var result    = validator.Validate(request);

            var output = result.IsSuccess ? wrapped.EditProject(request) : responseFactory();

            output.ValidationResult = result;

            return(output);
        }
コード例 #3
0
ファイル: ProjectEditor.cs プロジェクト: csf-dev/agiil
        public EditProjectResponse EditProject(EditProjectRequest request)
        {
            var project = data.Get(request.Identity);

            if (project == null)
            {
                throw new ArgumentException($"The project {request.Identity} does not exist.", nameof(request));
            }

            mapper.Map(request, project);

            var response = responseFactory();

            response.Project = project;
            return(response);
        }