Reputation: 2022
I wanted to store change the connection string so that it points to existing database that has all the necessary tables. when searched for "DefaultConnection" i am not able to find that any where in the application, Models folder does not have any of the models related to classes. All i see is the interface definitions is metaData. I can change the connection string value in the web.config to make it work, but now i am kind of intriguing to know how it implemented so that in case i want to customize the logic, where can i find those classes ?
I am using the latest version of WebAPI and using VS 2013.
What is confusing me is where how to modify the classes to implement custom logic, i can't find the model classes related to identity.
Upvotes: 0
Views: 552
Reputation: 101604
You were right, the web.config is the place to change it. Though can implement another constructor in your ApplicationDbContext
which calls the base [IdentityDbContext<TUser>
] class' constructor which accepts a nameOrConnectionString
. From there it's either specify to use :base("Data Source=...;Initial Catalog=...;...")
or use your new overriden constructor.
Also, your user should (by default) be something called ApplicationUser
which inherits from the IdentityUser
(which is just a dummy class that implement IUser
and adds some foreign keys like Claims
, Logins
and Roles
(among others)). So, if you need to customize it you should add your custom logic/properties to that object.
What's important to note is that everything but your context and custom (inherited) version of IdentityUser
are within the identity library. So, the only customization you're going to get is from the "ApplicationUser
" and "applicationDbContext"
on up.
Upvotes: 1