Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define custom collection name #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Define custom collection name #17

wants to merge 1 commit into from

Conversation

CXRom
Copy link

@CXRom CXRom commented Jun 11, 2014

Can define the name of the collection for store the information:

new UserStore<ApplicationUser>("MongoDB") { CollectionName = "MyUserCollection" })

Verified

This commit was signed with the committer’s verified signature.
fwyzard Andrea Bocci
Can define the name of the collection for store the information:

new UserStore<ApplicationUser>("MongoDB") { CollectionName =
"MyUserCollection" })
@kingdango
Copy link

The lack of this is the reason I am rolling my own based on this code -- I guess that's not a great reason.

Also, IMHO the library should be refactored to use a MongoCollection instead of a MongoDb and a collection name. I don't see a compelling reason to put db connection logic in this library when it almost definitely already exists in the consuming code. http://en.wikipedia.org/wiki/Solid_(object-oriented_design)

Perhaps:

    var userCollection = myMongoDb.GetCollection<TUser>("MyUserCollectionName");
    new UserStore<ApplicationUser>(userCollection);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants