public void Init() { ContentleverageContext dbRepository = new ContentleverageContext(); _authorQueries = new AuthorQueries(dbRepository); _authorCmds = new AuthorCommands(dbRepository); }
public Query( CMSGraphQLSchema schema, AuthorQueries author ) : base("Query", "The root query type") { schema.AddKnownType(this); schema.Query(this); this.Field("author", (int?pageIndex, int?pageSize) => author.Get(pageIndex.Value, pageSize.Value)) .WithDefaultValue("pageIndex", 0) .WithDefaultValue("pageSize", 20); }
public Mutation( CMSGraphQLSchema schema, CommandService commandService, AuthorQueries authorQueries) : base("Mutation", "The root mutation type") { this.authorQueries = authorQueries; this.commandService = commandService; schema.AddKnownType(this); schema.Mutation(this); this.AddFields(); }
public AuthorServices(IDbContext dbContext, AuthorQueries authorQueries, ILogger <AuthorServices> logger) { this.Collection = dbContext?.Database.GetCollection <Author>($"{nameof(Author)}s") ?? throw new ArgumentNullException(nameof(dbContext)); this._authorQueries = authorQueries; this._logger = logger; }