示例#1
0
        public static void Main(string[] args)
        {
            Log.Logger = new LoggerConfiguration()
                         .WriteTo
                         .ColoredConsole()
                         .MinimumLevel.Verbose()
                         .CreateLogger();

            var streamStore = new InMemoryStreamStore();

            var builder = new AppBuilder();

            builder.Use(SqlStreamStoreHalMiddleware.UseSqlStreamStoreHal(streamStore));

            var server = ServerBuilder.New()
                         .SetEndPoint(new IPEndPoint(IPAddress.Loopback, 8080))
                         .SetOwinApp(builder.Build());


            using (streamStore)
                using (server.Build())
                    using (server.Start())
                    {
                        DisplayMenu(streamStore);
                    }
        }
 public MiddlewareFixture()
 {
     StreamStore = new InMemoryStreamStore();
     HttpClient  = new HttpClient(
         new OwinHttpMessageHandler(SqlStreamStoreHalMiddleware.UseSqlStreamStoreHal(StreamStore)))
     {
         BaseAddress           = new UriBuilder().Uri,
         DefaultRequestHeaders = { Accept = { new MediaTypeWithQualityHeaderValue("application/hal+json") } }
     };
 }
示例#3
0
 public SqlStreamStoreHalMiddlewareFixture()
 {
     StreamStore = new InMemoryStreamStore();
     _inner      = new MiddlewareFixture(SqlStreamStoreHalMiddleware.UseSqlStreamStoreHal(StreamStore));
 }
 private static Action <BuildFunc> Configure(IStreamStore streamStore)
 => builder => builder
 .Use(CatchAndDisplayErrors)
 .Use(AllowAllOrigins)
 .Use(SqlStreamStoreHalMiddleware.UseSqlStreamStoreHal(streamStore));