This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

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>(IServiceCollection services)

Register a concrete service whose instance is managed by FileWatchDependencyFactory.

Parameters

services IServiceCollection

Returns

IServiceCollection

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

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>(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)
; }