FileWatchedServiceExtensions Pennington.Infrastructure
DI helpers for registering services whose lifetimes are bound to file-change invalidation.
Methods
AddFileWatched<T>
#public static IServiceCollection AddFileWatched<T>(this IServiceCollection services)
where T : class;Register a concrete service whose instance is managed by FileWatchDependencyFactory.
Parameters
servicesIServiceCollection
Returns
IServiceCollectionAddFileWatched<TService, TImplementation>
#public static IServiceCollection AddFileWatched<TService, TImplementation>(
this IServiceCollection services)
where TService : class
where TImplementation : class, TService;Register a service whose instance is managed by FileWatchDependencyFactory. The factory (singleton) recreates the instance when watched files change. 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>(this IServiceCollection services)
where T : class;
/// Register a service whose instance is managed by FileWatchDependencyFactory. The factory (singleton) recreates the instance when watched files change. The service (transient) always returns the current instance from the factory.
public static IServiceCollection AddFileWatched<TService, TImplementation>(
this IServiceCollection services)
where TService : class
where TImplementation : class, TService;
}