Class VirtualRoleBuilder
A builder used to build virtual roles
Inheritance
System.Object
    VirtualRoleBuilder
  Namespace: EPiServer.Security
Assembly: EPiServer.Framework.dll
Version: 12.0.3Syntax
public class VirtualRoleBuilder : Object
  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(IServiceProvider)
Builds a new VirtualRoleProviderBase instance.
Declaration
public VirtualRoleProviderBase Build(IServiceProvider serviceProvider)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.IServiceProvider | serviceProvider | The service provider 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.  |