Class TypeCollectionBuilderBase<TBuilder, TCollection, TConstraint>
Provides a base class for collections of types.
Inheritance
object
Namespace: Umbraco.Cms.Core.Composing
Assembly: Umbraco.Core.dll
Syntax
public abstract class TypeCollectionBuilderBase<TBuilder, TCollection, TConstraint> : ICollectionBuilder<TCollection, Type>, ICollectionBuilder where TBuilder : TypeCollectionBuilderBase<TBuilder, TCollection, TConstraint> where TCollection : class, IBuilderCollection<Type>
Type Parameters
| Name | Description |
|---|---|
| TBuilder | |
| TCollection | |
| TConstraint |
Constructors
View SourceTypeCollectionBuilderBase()
Declaration
protected TypeCollectionBuilderBase()
Properties
View SourceThis
Gets the current builder instance.
Declaration
protected abstract TBuilder This { get; }
Property Value
| Type | Description |
|---|---|
| TBuilder |
Methods
View SourceAdd(IEnumerable<Type>)
Adds multiple types to the collection.
Declaration
public TBuilder Add(IEnumerable<Type> types)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<Type> | types | The types to add. |
Returns
| Type | Description |
|---|---|
| TBuilder | The builder. |
Add(Type)
Adds a type to the collection.
Declaration
public TBuilder Add(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The type to add. |
Returns
| Type | Description |
|---|---|
| TBuilder | The builder. |
Add<T>()
Adds a type to the collection.
Declaration
public TBuilder Add<T>()
Returns
| Type | Description |
|---|---|
| TBuilder | The builder. |
Type Parameters
| Name | Description |
|---|---|
| T | The type to add. |
CreateCollection(IServiceProvider)
Creates a collection.
Declaration
public TCollection CreateCollection(IServiceProvider factory)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceProvider | factory |
Returns
| Type | Description |
|---|---|
| TCollection | A collection. |
Remarks
Creates a new collection each time it is invoked.
RegisterWith(IServiceCollection)
Registers the builder so it can build the collection, by registering the collection and the types.
Declaration
public void RegisterWith(IServiceCollection services)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services |
Remove(Type)
Removes a type from the collection.
Declaration
public TBuilder Remove(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The type to remove. |
Returns
| Type | Description |
|---|---|
| TBuilder | The builder. |
Remove<T>()
Removes a type from the collection.
Declaration
public TBuilder Remove<T>()
Returns
| Type | Description |
|---|---|
| TBuilder | The builder. |
Type Parameters
| Name | Description |
|---|---|
| T | The type to remove. |