<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="11.0.0-preview.3.26207.106" />

Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher

Watches a physical file system for changes and triggers events on IChangeToken when files are created, change, renamed, or deleted.
public PhysicalFilesWatcher(string root, FileSystemWatcher fileSystemWatcher, bool pollForChanges)

Initializes a new instance of the PhysicalFilesWatcher class that watches files in root. Wraps an instance of FileSystemWatcher.

public PhysicalFilesWatcher(string root, FileSystemWatcher fileSystemWatcher, bool pollForChanges, ExclusionFilters filters)

Initializes a new instance of the PhysicalFilesWatcher class that watches files in root. Wraps an instance of FileSystemWatcher.

public IChangeToken CreateFileChangeToken(string filter)

Creates an instance of IChangeToken for all files and directories that match the filter.

public void Dispose()

Disposes the provider. Change tokens may not trigger after the provider is disposed.

protected virtual void Dispose(bool disposing)

Disposes the provider.