Пример #1
0
 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
 public void Configure(IApplicationBuilder app, IHostingEnvironment env, HuntContext dbContext)
 {
     if (env.IsDevelopment())
     {
         app.UseDeveloperExceptionPage();
     }
     dbContext.Database.Migrate();
     //app.UseCors(builder=>builder.AllowAnyOrigin());
     app.Use(async(context, next) =>
     {
         await next();
         if (context.Response.StatusCode == 404 &&
             !Path.HasExtension(context.Request.Path.Value) &&
             !context.Request.Path.Value.StartsWith("/api/"))
         {
             context.Request.Path = "/index.html";
             await next();
         }
     });
     //app.UseSwagger();
     //app.UseSwaggerUI(c =>
     //{
     //  c.SwaggerEndpoint("/swagger/v1/swagger.json", "ImageHuntApi SwaggerDoc");
     //});
     app.UseMvcWithDefaultRoute();
     app.UseDefaultFiles();
     app.UseStaticFiles();
     app.UseMvc();
     app.UseSignalR(routes => { routes.MapHub <LocationHub>("/locationHub"); });
     ConfigureMappings();
 }
Пример #2
0
        public ContextBasedTest()
        {
            var dbContextOptionsBuilder = new DbContextOptionsBuilder <HuntContext>()
                                          .UseSqlite("DataSource=:memory:")
                                          .EnableSensitiveDataLogging();

            _context = new HuntContext(dbContextOptionsBuilder.Options);
            _context.Database.OpenConnection();
            _context.Database.EnsureCreated();
            _context.Database.ExecuteSqlCommand("alter table Nodes add Coordinate point null;");
        }
Пример #3
0
 public GameService(HuntContext context, ILogger <GameService> logger) : base(context, logger)
 {
 }
Пример #4
0
 public ImageService(HuntContext context, ILogger <ImageService> logger) : base(context, logger)
 {
 }
Пример #5
0
 public ActionService(HuntContext context, ILogger <ActionService> logger)
     : base(context, logger)
 {
 }
Пример #6
0
 public AbstractService(HuntContext context, ILogger logger)
 {
     Context = context;
     _logger = logger;
 }
Пример #7
0
 public TokenAuthorizationHandler(HuntContext context)
 {
     _context = context;
 }
Пример #8
0
 public NodeService(HuntContext context, ILogger <NodeService> logger) : base(context, logger)
 {
 }
Пример #9
0
 public PlayerService(HuntContext context, ILogger <PlayerService> logger) : base(context, logger)
 {
 }
Пример #10
0
 public TeamService(HuntContext context, ILogger <TeamService> logger)
     : base(context, logger)
 {
 }
Пример #11
0
 public ValuesController(IServiceContext context, IHubContext <EventingHub> hubContext, HuntContext huntContext)
 {
     this.context     = context;
     this.hubContext  = hubContext;
     this.huntContext = huntContext;
 }
Пример #12
0
 public AuthService(HuntContext context, ILogger <AuthService> logger) : base(context, logger)
 {
 }