This site provides a machine-readable index at /llms.txt.

Skip to main content Skip to navigation

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

services IServiceCollection

Returns

IServiceCollection

AddFileWatched<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

services IServiceCollection

Returns

IServiceCollection

Pennington.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;
}