SaaS CMS has officially launched! Learn more now.

Class EventProviderBuilder

Used to configure and build a EventProvider.

Inheritance
System.Object
EventProviderBuilder
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Events
Assembly: EPiServer.Events.dll
Version: 11.20.7
Syntax
public class EventProviderBuilder

Constructors

EventProviderBuilder(String, Type)

Initializes a new instance of the EventProviderBuilder class.

Declaration
public EventProviderBuilder(string name, Type providerType)
Parameters
Type Name Description
System.String name

The name of the event provider

System.Type providerType

The type of the provider instance. Must implement EventProvider.

Properties

Name

Gets the name of the EventProvider.

Declaration
public string Name { get; }
Property Value
Type Description
System.String

ProviderType

Gets the type of the EventProvider.

Declaration
public Type ProviderType { get; }
Property Value
Type Description
System.Type

Methods

Build(IServiceLocator)

Builds a new EventProvider instance.

Declaration
public EventProvider Build(IServiceLocator serviceLocator)
Parameters
Type Name Description
IServiceLocator serviceLocator

The service locator used to create provider instances.

Returns
Type Description
EventProvider

A new EventProvider instance.

Configure<TProviderOptions>(Action<TProviderOptions>)

Adds a configuration of the provider.

Declaration
public EventProviderBuilder Configure<TProviderOptions>(Action<TProviderOptions> configure)
    where TProviderOptions : class, new()
Parameters
Type Name Description
System.Action<TProviderOptions> configure

A method used to configure the options for this provider.

Returns
Type Description
EventProviderBuilder
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 EventProviderBuilder instance.

Declaration
public static EventProviderBuilder Create<TProvider>(string name = null)
    where TProvider : EventProvider
Parameters
Type Name Description
System.String name

The name of the provider.

Returns
Type Description
EventProviderBuilder

A new EventProviderBuilder instance.

Type Parameters
Name Description
TProvider

Type of the provider instance. Must implement the EventProvider class.

Remarks

If no name is provided, the provider will be assigned a randomly generated name

Extension Methods