Interface IStoragePathRegistry
Provides methods for registering and querying file system paths used by the application.
public interface IStoragePathRegistry
- Extension Methods
Remarks
Modules should register their file system paths during initialization with the appropriate PathType.
Consumers (such as storage initialization modules) can query the registry to determine which paths need to be mapped to which storage type in cloud or web farm deployments.
The registry stores path intent, not environment-specific mapping decisions. Environment-specific behavior (for example cloud vs local development) should be implemented by mapping modules that consume this API.
Methods
GetRegistrations()
Gets all registered paths with their metadata.
IEnumerable<PathRegistration> GetRegistrations()
Returns
- IEnumerable<PathRegistration>
Collection of all path registrations.
Remarks
The returned collection does not guarantee ordering. If consumers require stable ordering, they should explicitly sort the results.
GetRegistrations(PathType)
Gets all paths registered with the specified path type.
IEnumerable<PathRegistration> GetRegistrations(PathType pathType)
Parameters
pathTypePathTypeThe path type to query.
Returns
- IEnumerable<PathRegistration>
Collection of path registrations with the specified type.
RegisterPath(string, PathType)
Registers a file system path with the specified type.
void RegisterPath(string path, PathType pathType)
Parameters
pathstringThe path to register (e.g., "~/assets/BizFormFiles").
pathTypePathTypeThe type of the path.
Remarks
The pathType parameter captures the storage intent of the path (for example shared
persistent data or shared temporary data). It should describe the nature of the data, not a concrete
provider implementation.
Supported path formats include app-root-relative paths (for example ~/assets/media),
non-rooted relative paths (for example assets/media), and fully qualified absolute paths.
On Windows, root-relative paths without a drive or UNC root (for example /path or \path)
are not supported and cause an System.ArgumentException.
Exceptions
- ArgumentException
Thrown when
pathis null, empty, whitespace, or is a Windows root-relative path without a drive or UNC root.- InvalidOperationException
Thrown when
pathis already registered.