public EditProjectResponse EditProject(EditProjectRequest request)
 {
     using (var tran = transactionCreator.GetTransaction())
     {
         var output = wrapped.EditProject(request);
         tran.Commit();
         return(output);
     }
 }
        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
        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);
        }