Show / Hide Table of Contents

# Class OpenIddictMongoDbBuilder

Exposes the necessary methods required to configure the OpenIddict MongoDB services.

##### Inheritance

System.Object
OpenIddictMongoDbBuilder

##### Inherited Members

System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)

###### Namespace: Microsoft.Extensions.DependencyInjection

###### Assembly: cs.temp.dll.dll

##### Syntax

    public class OpenIddictMongoDbBuilder

### Constructors

#### OpenIddictMongoDbBuilder(IServiceCollection)

Initializes a new instance of OpenIddictMongoDbBuilder.

##### Declaration

    public OpenIddictMongoDbBuilder(IServiceCollection services)

##### Parameters

Type | Name | Description
--- | --- | ---
IServiceCollection | services | The services collection.

### Properties

#### Services

Gets the services collection.

##### Declaration

    public IServiceCollection Services { get; }

##### Property Value

Type | Description
--- | ---
IServiceCollection |

### Methods

#### Configure(Action<OpenIddictMongoDbOptions>)

Amends the default OpenIddict MongoDB configuration.

##### Declaration

    public OpenIddictMongoDbBuilder Configure(Action<OpenIddictMongoDbOptions> configuration)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Action<OpenIddictMongoDbOptions> | configuration | The delegate used to configure the OpenIddict options.

##### Returns

Type | Description
--- | ---
OpenIddictMongoDbBuilder | The OpenIddictMongoDbBuilder.

##### Remarks

This extension can be safely called multiple times.

#### Equals(Object)

##### Declaration

    public override bool Equals(object obj)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Object | obj |

##### Returns

Type | Description
--- | ---
System.Boolean |

##### Overrides

System.Object.Equals(System.Object)

#### GetHashCode()

##### Declaration

    public override int GetHashCode()

##### Returns

Type | Description
--- | ---
System.Int32 |

##### Overrides

System.Object.GetHashCode()

#### ReplaceDefaultApplicationEntity<TApplication>()

Configures OpenIddict to use the specified entity as the default application entity.

##### Declaration

    public OpenIddictMongoDbBuilder ReplaceDefaultApplicationEntity<TApplication>()
        where TApplication : OpenIddictMongoDbApplication

##### Returns

Type | Description
--- | ---
OpenIddictMongoDbBuilder | The OpenIddictMongoDbBuilder.

##### Type Parameters

Name | Description
--- | ---
TApplication |

#### ReplaceDefaultAuthorizationEntity<TAuthorization>()

Configures OpenIddict to use the specified entity as the default authorization entity.

##### Declaration

    public OpenIddictMongoDbBuilder ReplaceDefaultAuthorizationEntity<TAuthorization>()
        where TAuthorization : OpenIddictMongoDbAuthorization

##### Returns

Type | Description
--- | ---
OpenIddictMongoDbBuilder | The OpenIddictMongoDbBuilder.

##### Type Parameters

Name | Description
--- | ---
TAuthorization |

#### ReplaceDefaultScopeEntity<TScope>()

Configures OpenIddict to use the specified entity as the default scope entity.

##### Declaration

    public OpenIddictMongoDbBuilder ReplaceDefaultScopeEntity<TScope>()
        where TScope : OpenIddictMongoDbScope

##### Returns

Type | Description
--- | ---
OpenIddictMongoDbBuilder | The OpenIddictMongoDbBuilder.

##### Type Parameters

Name | Description
--- | ---
TScope |

#### ReplaceDefaultTokenEntity<TToken>()

Configures OpenIddict to use the specified entity as the default token entity.

##### Declaration

    public OpenIddictMongoDbBuilder ReplaceDefaultTokenEntity<TToken>()
        where TToken : OpenIddictMongoDbToken

##### Returns

Type | Description
--- | ---
OpenIddictMongoDbBuilder | The OpenIddictMongoDbBuilder.

##### Type Parameters

Name | Description
--- | ---
TToken |

#### SetApplicationsCollectionName(String)

Replaces the default applications collection name (by default, openiddict.applications).

##### Declaration

    public OpenIddictMongoDbBuilder SetApplicationsCollectionName(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name | The collection name

##### Returns

Type | Description
--- | ---
OpenIddictMongoDbBuilder | The OpenIddictMongoDbBuilder.

#### SetAuthorizationsCollectionName(String)

Replaces the default authorizations collection name (by default, openiddict.authorizations).

##### Declaration

    public OpenIddictMongoDbBuilder SetAuthorizationsCollectionName(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name | The collection name

##### Returns

Type | Description
--- | ---
OpenIddictMongoDbBuilder | The OpenIddictMongoDbBuilder.

#### SetScopesCollectionName(String)

Replaces the default scopes collection name (by default, openiddict.scopes).

##### Declaration

    public OpenIddictMongoDbBuilder SetScopesCollectionName(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name | The collection name

##### Returns

Type | Description
--- | ---
OpenIddictMongoDbBuilder | The OpenIddictMongoDbBuilder.

#### SetTokensCollectionName(String)

Replaces the default tokens collection name (by default, openiddict.tokens).

##### Declaration

    public OpenIddictMongoDbBuilder SetTokensCollectionName(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name | The collection name

##### Returns

Type | Description
--- | ---
OpenIddictMongoDbBuilder | The OpenIddictMongoDbBuilder.

#### ToString()

##### Declaration

    public override string ToString()

##### Returns

Type | Description
--- | ---
System.String |

##### Overrides

System.Object.ToString()

#### UseDatabase(IMongoDatabase)

Configures the MongoDB stores to use the specified database instead of retrieving it from the dependency injection container.

##### Declaration

    public OpenIddictMongoDbBuilder UseDatabase(IMongoDatabase database)

##### Parameters

Type | Name | Description
--- | --- | ---
IMongoDatabase | database | The .

##### Returns

Type | Description
--- | ---
OpenIddictMongoDbBuilder | The OpenIddictMongoDbBuilder.