コード例 #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, GraphQlDbContext dbContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            dbContext.Database.EnsureCreated();
            app.UseGraphiQl("/graphql");
            app.UseGraphQL <ISchema>();
        }
コード例 #2
0
        public static void SeedHostDb(GraphQlDbContext context)
        {
            context.SuppressAutoSetTenantId = true;

            // Host seed
            new InitialHostDbBuilder(context).Create();

            // Default tenant seed (in host database).
            new DefaultTenantBuilder(context).Create();
            new TenantRoleAndUserBuilder(context, 1).Create();
        }
コード例 #3
0
 public CustomerQuery(GraphQlDbContext appContext)
 {
     this._appContext = appContext;
     Name             = "Query";
     Field <ListGraphType <CustomerGraphType> >("customers", "Returns a list of Customer", resolve: context => _appContext.Customers.ToList());
     Field <CustomerGraphType>("customer", "Returns a Single Customer",
                               new QueryArguments(new QueryArgument <NonNullGraphType <IntGraphType> > {
         Name = "id", Description = "Customer Id"
     }),
                               context => _appContext.Customers.Single(x => x.Id == context.Arguments["id"].GetPropertyValue <int>()));
 }
コード例 #4
0
 public SubMenuService(GraphQlDbContext dbContext)
 {
     _dbContext = dbContext;
 }
コード例 #5
0
 public DefaultEditionCreator(GraphQlDbContext context)
 {
     _context = context;
 }
コード例 #6
0
 public ReservationService(GraphQlDbContext dbContext)
 {
     _dbContext = dbContext;
 }
コード例 #7
0
 public HostRoleAndUserCreator(GraphQlDbContext context)
 {
     _context = context;
 }
コード例 #8
0
 public InitialHostDbBuilder(GraphQlDbContext context)
 {
     _context = context;
 }
コード例 #9
0
 public TenantRoleAndUserBuilder(GraphQlDbContext context, int tenantId)
 {
     _context  = context;
     _tenantId = tenantId;
 }
コード例 #10
0
 public DefaultLanguagesCreator(GraphQlDbContext context)
 {
     _context = context;
 }
コード例 #11
0
 public DefaultSettingsCreator(GraphQlDbContext context)
 {
     _context = context;
 }
コード例 #12
0
 public DefaultTenantBuilder(GraphQlDbContext context)
 {
     _context = context;
 }