Пример #1
0
 public override void Configure(Container container)
 {
     // I add some request/response filters to set up the correct database
     // connection for the integration test database
     RequestFilters.Add((httpRequest, httpResponse, requestDto) =>
     {
         var dbContext = MakeSomeDatabaseContext();
         httpRequest.Items["DatabaseIntegrationTestContext"] = dbContext;
     });
     ResponseFilters.Add((httpRequest, httpResponse, responseDto) =>
     {
         var dbContext = httpRequest.Items["DatabaseIntegrationTestContext"] as DbContext;
         if (dbContext != null)
         {
             dbContext.Dispose();
             httpRequest.Items.Remove("DatabaseIntegrationTestContext");
         }
     });
     // now include any configuration you want to share between this
     // and your regular AppHost, e.g. IoC setup, EndpointHostConfig,
     // JsConfig setup, adding Plugins, etc.
     SharedAppHost.Configure(container);
 }
Пример #2
0
 public override void Configure(Container container) => SharedAppHost.Configure(this);