<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="11.0.0-rc.3.26522.148" />

Microsoft.Extensions.FileProviders.Physical.PollingFileChangeToken

public class PollingFileChangeToken : IPollingChangeToken, IChangeToken
A change token that polls for file system changes.
public bool ActiveChangeCallbacks { get; }

Gets a value that indicates whether this token will proactively raise callbacks. If false, the token consumer must poll HasChanged to detect changes.

public bool HasChanged { get; }

Gets a value that indicates whether the file or directory has changed since the change token was created.

Initializes a new instance of the PollingFileChangeToken class that polls the specified file or directory for changes as determined by LastWriteTimeUtc.

public IDisposable RegisterChangeCallback(Action<object> callback, object state)

Registers a callback that will be invoked when the token changes, if ActiveChangeCallbacks is true. If ActiveChangeCallbacks is false, no callback is registered and an empty disposable is returned.