public override async Task<HttpResponseMessage> ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken) { using (_dispatcher = new Dispatcher(Provider.DocumentStore.OpenSession())) { var result = await base.ExecuteAsync(controllerContext, cancellationToken); _dispatcher.Commit(); return result; } }