Table of Contents

Class ServiceCollectionExtensions

Namespace
Datafication.Server.Core.Extensions
Assembly
Datafication.Server.Core.dll

Extension methods for configuring Datafication Server services.

public static class ServiceCollectionExtensions
Inheritance
object
ServiceCollectionExtensions

Methods

AddDataBlockRegistry(IServiceCollection)

Adds the DataBlock registry with default configuration.

public static IServiceCollection AddDataBlockRegistry(this IServiceCollection services)

Parameters

services IServiceCollection

The service collection.

Returns

IServiceCollection

The service collection for chaining.

Examples

services.AddDataBlockRegistry();

AddDataBlockRegistry(IServiceCollection, RegistryPreset)

Adds the DataBlock registry with a predefined configuration preset.

public static IServiceCollection AddDataBlockRegistry(this IServiceCollection services, RegistryPreset preset)

Parameters

services IServiceCollection

The service collection.

preset RegistryPreset

The configuration preset to use.

Returns

IServiceCollection

The service collection for chaining.

Examples

// Development - detailed logging, short cache, no compression
services.AddDataBlockRegistry(RegistryPreset.Development);

// Production - compression, longer cache, background maintenance
services.AddDataBlockRegistry(RegistryPreset.Production);

// Enterprise - all features, analytics, large cache
services.AddDataBlockRegistry(RegistryPreset.Enterprise);

AddDataBlockRegistry(IServiceCollection, Action<MetaRegistryOptions>)

Adds the DataBlock registry with custom configuration.

public static IServiceCollection AddDataBlockRegistry(this IServiceCollection services, Action<MetaRegistryOptions> configureOptions)

Parameters

services IServiceCollection

The service collection.

configureOptions Action<MetaRegistryOptions>

Action to configure registry options.

Returns

IServiceCollection

The service collection for chaining.

Examples

services.AddDataBlockRegistry(options =>
{
    options.EnableCaching = true;
    options.MaxCacheSize = 500;
    options.CacheEvictionTime = TimeSpan.FromMinutes(30);
    options.CompressSerializedData = true;
});

AddDataBlockRegistry(IServiceCollection, Action<MetaRegistryOptions>, bool, bool)

Adds the DataBlock registry with custom configuration and optional services.

public static IServiceCollection AddDataBlockRegistry(this IServiceCollection services, Action<MetaRegistryOptions> configureOptions, bool includeMaintenanceService, bool includeAnalytics = false)

Parameters

services IServiceCollection

The service collection.

configureOptions Action<MetaRegistryOptions>

Action to configure registry options.

includeMaintenanceService bool

Whether to include background maintenance.

includeAnalytics bool

Whether to include analytics service.

Returns

IServiceCollection

The service collection for chaining.

AddDataBlockRegistry<TCache>(IServiceCollection, Action<MetaRegistryOptions>?)

Adds the DataBlock registry with a custom cache implementation.

public static IServiceCollection AddDataBlockRegistry<TCache>(this IServiceCollection services, Action<MetaRegistryOptions>? configureOptions = null) where TCache : class, IDataCache

Parameters

services IServiceCollection

The service collection.

configureOptions Action<MetaRegistryOptions>

Action to configure registry options.

Returns

IServiceCollection

The service collection for chaining.

Type Parameters

TCache

The cache implementation type.

AddDataficationServer(IServiceCollection)

Adds Datafication Server services to the dependency injection container.

public static IServiceCollection AddDataficationServer(this IServiceCollection services)

Parameters

services IServiceCollection

The service collection.

Returns

IServiceCollection

The service collection for chaining.

AddDataficationServer(IServiceCollection, Action<DataBlockServerOptions>)

Adds Datafication Server services to the dependency injection container with configuration.

public static IServiceCollection AddDataficationServer(this IServiceCollection services, Action<DataBlockServerOptions> configureOptions)

Parameters

services IServiceCollection

The service collection.

configureOptions Action<DataBlockServerOptions>

Action to configure the server options.

Returns

IServiceCollection

The service collection for chaining.

AddDataficationServer(IServiceCollection, Action<DataBlockServerOptions>, Action<AuthorizationOptions>)

Adds Datafication Server services with custom authorization policies.

public static IServiceCollection AddDataficationServer(this IServiceCollection services, Action<DataBlockServerOptions> configureOptions, Action<AuthorizationOptions> configureAuthorization)

Parameters

services IServiceCollection

The service collection.

configureOptions Action<DataBlockServerOptions>

Action to configure the server options.

configureAuthorization Action<AuthorizationOptions>

Action to configure custom authorization policies.

Returns

IServiceCollection

The service collection for chaining.

AddDataficationServer<TRegistry>(IServiceCollection, Action<DataBlockServerOptions>)

Adds Datafication Server services with a custom registry implementation.

public static IServiceCollection AddDataficationServer<TRegistry>(this IServiceCollection services, Action<DataBlockServerOptions> configureOptions) where TRegistry : class, IDataBlockRegistry

Parameters

services IServiceCollection

The service collection.

configureOptions Action<DataBlockServerOptions>

Action to configure the server options.

Returns

IServiceCollection

The service collection for chaining.

Type Parameters

TRegistry

The type of the custom registry implementation.