Exemplo n.º 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>();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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>()));
 }
Exemplo n.º 4
0
 public SubMenuService(GraphQlDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 5
0
 public DefaultEditionCreator(GraphQlDbContext context)
 {
     _context = context;
 }
 public ReservationService(GraphQlDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 7
0
 public HostRoleAndUserCreator(GraphQlDbContext context)
 {
     _context = context;
 }
Exemplo n.º 8
0
 public InitialHostDbBuilder(GraphQlDbContext context)
 {
     _context = context;
 }
Exemplo n.º 9
0
 public TenantRoleAndUserBuilder(GraphQlDbContext context, int tenantId)
 {
     _context  = context;
     _tenantId = tenantId;
 }
Exemplo n.º 10
0
 public DefaultLanguagesCreator(GraphQlDbContext context)
 {
     _context = context;
 }
Exemplo n.º 11
0
 public DefaultSettingsCreator(GraphQlDbContext context)
 {
     _context = context;
 }
Exemplo n.º 12
0
 public DefaultTenantBuilder(GraphQlDbContext context)
 {
     _context = context;
 }