Table of Contents

Class StoragePathServiceCollectionExtensions

Namespace
CMS.IO
Assembly
CMS.IO.dll

Extension methods for registering storage paths via Microsoft.Extensions.DependencyInjection.IServiceCollection.

public static class StoragePathServiceCollectionExtensions
Inheritance
object
StoragePathServiceCollectionExtensions

Remarks

Registered paths are collected during service configuration and applied to IStoragePathRegistry during module initialization.

These methods can be used both in application startup (builder.Services) and in module OnPreInit (parameters.Services).

Methods

AddStoragePathRegistration(IServiceCollection, string, PathType)

Registers a single storage path in the IStoragePathRegistry.

public static IServiceCollection AddStoragePathRegistration(this IServiceCollection services, string path, PathType pathType)

Parameters

services IServiceCollection

The Microsoft.Extensions.DependencyInjection.IServiceCollection to add the registration to.

path string

The path to register (e.g., "~/assets/custom").

pathType PathType

The type of the path.

Returns

IServiceCollection

The same Microsoft.Extensions.DependencyInjection.IServiceCollection so that additional calls can be chained.

Exceptions

ArgumentNullException

Thrown when services is null.

ArgumentException

Thrown when path is null, empty, or whitespace.