ServiceCollectionExtensions.

UseLifetime<TLifetime>(IServiceCollection) Method

Summary

Registers the specified lifetime type. Only the last registration will be used.
Namespace
Cake.Frosting
Containing Type
ServiceCollectionExtensions

Syntax

public static IServiceCollection UseLifetime<TLifetime>(this IServiceCollection services) 
    where TLifetime : class, IFrostingLifetime

Type Parameters

Name Description
TLifetime The type of the lifetime.

Parameters

Name Type Description
services IServiceCollection The service collection.

Return Value

Type Description
IServiceCollection The same IServiceCollection instance so that multiple calls can be chained.