November Happy Hour will be moved to Thursday December 5th.

Class OptionsBase<TFluentType, TOptionType>

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Base class for options supporting fluent operations based on a specifiec option type

Inheritance
System.Object
OptionsBase<TFluentType, TOptionType>
Implements
System.Collections.Generic.IEnumerable<TOptionType>
System.Collections.IEnumerable
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.Core.Internal
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
public abstract class OptionsBase<TFluentType, TOptionType> : IEnumerable<TOptionType>, IEnumerable where TFluentType : class
Type Parameters
Name Description
TFluentType
TOptionType

Constructors

OptionsBase()

Declaration
protected OptionsBase()

Methods

Add<T>(T)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Adds a new option

Declaration
public TFluentType Add<T>(T option)
    where T : TOptionType
Parameters
Type Name Description
T option

The option instance

Returns
Type Description
TFluentType

The option container

Type Parameters
Name Description
T

The type of option

Remarks

It will throw if the item already exist, use Set<T>(T) to overwrite.

Get<T>()

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Get an option of specified type or default(T) if option does not exist

Declaration
public T Get<T>()
    where T : TOptionType
Returns
Type Description
T

The option of specified type or default(T) if option does not exist

Type Parameters
Name Description
T

The type of option

Set<T>(T)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Sets a new option

Declaration
public TFluentType Set<T>(T option)
    where T : TOptionType
Parameters
Type Name Description
T option

The option instance

Returns
Type Description
TFluentType

The option container

Type Parameters
Name Description
T

The type of option

Remarks

If an option alreay exist of same type it will be overwritten

Setup<T>(Action<T>)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Setup a property on a option

Declaration
public TFluentType Setup<T>(Action<T> action)
    where T : TOptionType, new()
Parameters
Type Name Description
System.Action<T> action

The action that configures the option

Returns
Type Description
TFluentType

The option container

Type Parameters
Name Description
T

The type of option

Remarks

If an option alreay exist of same type it will not be overwritten

Explicit Interface Implementations

IEnumerable<TOptionType>.GetEnumerator()

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice.

Declaration
IEnumerator<TOptionType> IEnumerable<TOptionType>.GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<TOptionType>

IEnumerable.GetEnumerator()

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice.

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator

Implements

System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable

Extension Methods