public void ExpireChangeTokens() { // Use a new scope to get the file provider using (IServiceScope scope = _serviceScopeFactory.CreateScope()) { FileSystemFileProvider fileProvider = scope.ServiceProvider.GetService <FileSystemFileProvider>(); fileProvider.ExpireChangeTokens(); } }
public HostingEnvironment(IExecutionContext context) { EnvironmentName = "Wyam"; // This gets used to load dependencies and is passed to Assembly.Load() ApplicationName = typeof(HostingEnvironment).Assembly.FullName; WebRootPath = context.FileSystem.RootPath.FullPath; WebRootFileProvider = new FileSystemFileProvider(context.FileSystem); ContentRootPath = WebRootPath; ContentRootFileProvider = WebRootFileProvider; }
public HostingEnvironment(FileSystemFileProvider fileProvider) { EnvironmentName = "Wyam"; // This gets used to load dependencies and is passed to Assembly.Load() ApplicationName = typeof(HostingEnvironment).Assembly.FullName; WebRootPath = fileProvider.WyamFileSystem.RootPath.FullPath; WebRootFileProvider = fileProvider; ContentRootPath = WebRootPath; ContentRootFileProvider = WebRootFileProvider; }