public void Process(NewArticleRequest newArticleRequest) { var articleToSave = _mapper.Map<Article>(newArticleRequest.Article); _commandRepository.CreateArticle(articleToSave); }
public object Handle(NewArticleRequest newArticleRequest) { string[] validationErrors; if (!newArticleRequest.Article.Validate(out validationErrors, true)) { throw new WebFaultException<WebFaultDto>( new WebFaultDto("Не удалось добавить статью", string.Join("\n", validationErrors)), HttpStatusCode.BadRequest); } _queue.PushMessage(newArticleRequest); return null; }