Class ContentProviderBuilder
Used to configure and build up Content
Inheritance
Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 12.0.3Syntax
public class ContentProviderBuilder : Object
Constructors
ContentProviderBuilder(String, Type)
Initializes a new instance of the Content
Declaration
public ContentProviderBuilder(string name, Type providerType)
Parameters
Type | Name | Description |
---|---|---|
System. |
name | The name of the content provider |
System. |
providerType | The type of the provider instance. Must implement Content |
Remarks
It's recommended to use the Create<TProvider>(String) method to initialize new instances as it will provide type support.
Properties
AutoCorrectInvalidName
Gets or sets if an invalid provider name should be automatically corrected or if an exception should be thrown.
Declaration
public bool AutoCorrectInvalidName { get; set; }
Property Value
Type | Description |
---|---|
System. |
Name
Gets the name of the Content
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System. |
ProviderType
Gets the type of the Content
Declaration
public Type ProviderType { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
Build(IServiceProvider)
Builds a new Content
Declaration
public ContentProvider Build(IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
System. |
serviceProvider | The service provider used to create provider instances. |
Returns
Type | Description |
---|---|
Content |
A new Content |
Configure<TProviderOptions>(Action<TProviderOptions>)
Adds a configuration of the provider.
Declaration
public ContentProviderBuilder Configure<TProviderOptions>(Action<TProviderOptions> configure)
where TProviderOptions : class, new()
Parameters
Type | Name | Description |
---|---|---|
System. |
configure | A method used to configure the options for this provider. |
Returns
Type | Description |
---|---|
Content |
Type Parameters
Name | Description |
---|---|
TProviderOptions | The options type required by the provider configured by this instance. |
Create<TProvider>(String)
Factory method for creating a new Content
Declaration
public static ContentProviderBuilder Create<TProvider>(string name)
where TProvider : ContentProvider
Parameters
Type | Name | Description |
---|---|---|
System. |
name | The name of the Content |
Returns
Type | Description |
---|---|
Content |
A new Content |
Type Parameters
Name | Description |
---|---|
TProvider | Type of the provider instance. Must implement Content |