public CassetteApplication(IBundleContainer bundleContainer, CassetteSettings settings, CassetteRouteGenerator routeHandling, Func<NancyContext> getCurrentContext) : base(bundleContainer, settings) { if (getCurrentContext == null) throw new ArgumentNullException("getCurrentContext"); this.getCurrentContext = getCurrentContext; routeHandling.InstallCassetteRouteHandlers(bundleContainer); }
public CassetteStartup(IRootPathProvider rootPathProvider) { this.rootPathProvider = rootPathProvider; // This will trigger creation of the Cassette infrastructure at the time of the first request. // The virtual directory is not known until that point, and the virtual directory is required for creation. this.getApplication = InitializeApplication; CassetteApplicationContainer.SetApplicationAccessor(() => getApplication()); routeGenerator = new CassetteRouteGenerator(rootPathProvider.GetRootPath(), GetCurrentContext); }