Created
September 29, 2017 16:17
-
-
Save NMZivkovic/23b5c235534ef96f619461dfa4a96ed6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Class used to access Mongo DB. | |
/// </summary> | |
public class UsersRepository | |
{ | |
private IMongoClient _client; | |
private IMongoDatabase _database; | |
private IMongoCollection<User> _usersCollection; | |
public UsersRepository(string connectionString) | |
{ | |
_client = new MongoClient(connectionString); | |
_database = _client.GetDatabase("blog"); | |
_usersCollection = _database.GetCollection<User>("users"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment