dlmelendez/identitydocumentdb

Project creates a new DB - is this intentional?

Closed this issue · 1 comments

Hi,

Just trying to get this set up - it works fine, but it creates a new Users collection - I want this inside existing db. Is there any way to configure this?

Yes, make sure you are using version 1.3 or higher, following the sample code, the database name is in the web.config https://github.com/dlmelendez/identitydocumentdb/blob/master/sample/samplemvc/Web.config

<add key="IdDocDb_Database" value="yourDbNameHere" /> 

The collection names for users and roles can be over ridden in the IdentityContext constructor in https://github.com/dlmelendez/identitydocumentdb/blob/master/sample/samplemvc/Models/IdentityModels.cs

public class ApplicationDbContext : IdentityCloudContext<ApplicationUser>
    {
        public ApplicationDbContext()
            : base("existingcollectionname", "existingcollectionname")
        {
        }

This should get you going.
-Dave