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

Class VirtualRoleBuilder

Inheritance
System.Object
VirtualRoleBuilder
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.Security
Assembly: EPiServer.Framework.dll
Version: 11.20.7
Syntax
public class VirtualRoleBuilder

Constructors

VirtualRoleBuilder(String, Type)

Initializes a new instance of the VirtualRoleBuilder class.

Declaration
public VirtualRoleBuilder(string name, Type roleType)
Parameters
Type Name Description
System.String name
System.Type roleType

Properties

Name

Gets the name of the VirtualRoleProviderBase.

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

RoleType

Gets the type of the VirtualRoleProviderBase.

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

Methods

Build(IServiceLocator)

Builds a new VirtualRoleProviderBase instance.

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

The service locator used to create virtual role instances.

Returns
Type Description
VirtualRoleProviderBase

A new VirtualRoleProviderBase instance.

Configure<TRoleOptions>(Action<TRoleOptions>)

Adds a configuration of the role.

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

The method that will configure the options instance.

Returns
Type Description
VirtualRoleBuilder
Type Parameters
Name Description
TRoleOptions

The type of option to configure.

Create<TRole>(String)

Factory method for creating a new VirtualRoleBuilder instance.

Declaration
public static VirtualRoleBuilder Create<TRole>(string name)
    where TRole : VirtualRoleProviderBase
Parameters
Type Name Description
System.String name

The name of the VirtualRoleProviderBase.

Returns
Type Description
VirtualRoleBuilder

A new VirtualRoleBuilder instance.

Type Parameters
Name Description
TRole

Type of the role instance. Must implement VirtualRoleProviderBase.

Extension Methods