Esempio n. 1
0
 public ArticleController(
     IReadArticleService readArticleService,
     IWriteArticleService writeArticleService)
 {
     _readArticleService  = readArticleService;
     _writeArticleService = writeArticleService;
 }
Esempio n. 2
0
        public ArticleMutation(IWriteArticleService writeArticleService)
        {
            _writeArticleService = writeArticleService;
            Field <ArticleType>(
                "addArticle",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <CreateArticleInputType> >()
            {
                Name = "article"
            }
                    ),
                resolve: context =>
            {
                var article = context.GetArgument <CreateArticleModel>("article");
                return(_writeArticleService.Create(article));
            });

            RegisterDelete();
        }