FileWatchedServiceExtensions
Pennington.Infrastructure
DI helpers for registering services whose lifetimes are bound to file-change invalidation.
Methods
AddFileWatched<T>
#public static IServiceCollection AddFileWatched<T>(IServiceCollection services)
Register a concrete service whose instance is managed by FileWatchDependencyFactory.
Parameters
servicesIServiceCollection
Returns
IServiceCollectionAddFileWatched<TService, TImplementation>
#public static IServiceCollection AddFileWatched<TService, TImplementation>(IServiceCollection services)
Register a service whose instance is managed by FileWatchDependencyFactory. The factory (singleton) recreates the instance when the implementation's OnFileChanged returns Recreate. The service (transient) always returns the current instance from the factory.
Parameters
servicesIServiceCollection
Returns
IServiceCollectionPennington.Infrastructure.FileWatchedServiceExtensions
namespace Pennington.Infrastructure;
/// DI helpers for registering services whose lifetimes are bound to file-change invalidation.
public class FileWatchedServiceExtensions
{
/// Register a concrete service whose instance is managed by FileWatchDependencyFactory.
public static IServiceCollection AddFileWatched<T>(IServiceCollection services)
;
/// Register a service whose instance is managed by FileWatchDependencyFactory. The factory (singleton) recreates the instance when the implementation's OnFileChanged returns Recreate. The service (transient) always returns the current instance from the factory.
public static IServiceCollection AddFileWatched<TService, TImplementation>(IServiceCollection services)
;
}