C# Class Glipho.OAuth.Providers.Database.Mongo.Consumers

MongoDB implementation of the IConsumers database.
Inheritance: MongoDbClient, IConsumers
显示文件 Open project: Glipho/oauth-providers

Public Methods

Method Description
Consumers ( ) : System

Initialises a new instance of the Consumers class.

Consumers ( string connectionString ) : System

Initialises a new instance of the Consumers class.

Create ( Database newConsumer ) : Database.Consumer

Create a new consumer.

Get ( string id ) : Database.Consumer

Retrieve a consumer from the database.

List ( int offset, int limit ) : IList

List all consumers by name.

If there are no results with the given range, an empty list should be returned.

Private Methods

Method Description
EnsureIndexesExist ( ) : void

Ensure the relevant indexes exist.

InitialiseClass ( ) : void

Initialise the class.

Method Details

Consumers() public method

Initialises a new instance of the Consumers class.
public Consumers ( ) : System
return System

Consumers() public method

Initialises a new instance of the Consumers class.
public Consumers ( string connectionString ) : System
connectionString string The connection string.
return System

Create() public method

Create a new consumer.
Thrown if a parameter is not valid. Thrown if an error occurs while executing the requested command.
public Create ( Database newConsumer ) : Database.Consumer
newConsumer MongoDB.Driver.Database The to create.
return Database.Consumer

Get() public method

Retrieve a consumer from the database.
Thrown if a parameter is not valid. Thrown if an error occurs while executing the requested command.
public Get ( string id ) : Database.Consumer
id string The identifier of the consumer to retrieve.
return Database.Consumer

List() public method

List all consumers by name.

If there are no results with the given range, an empty list should be returned.

Thrown if a parameter is outside of a permitted range. Thrown if an error occurs while executing the requested command.
public List ( int offset, int limit ) : IList
offset int The amount to offset the results by. Minimum of 0.
limit int The maximum number of results to return. Maximum of 100.
return IList