I'm playing around with a web application using the above and visual studio 2016 community. I've pretty much still got the default project using Individual User Account as the authentication. So it's built all the views and models around authentication and I can register accounts and log in. I'm now wanting to add some attributes to the default and running into some unknowns.
First question is about writing some non-default attributes. I've looked into how it's writing the default attributes (email and phone) and there are actually methods in the UserManager library class to update these attributes
public virtual Task<IdentityResult> SetEmailAsync(TUser user, string email);
and
public virtual Task<IdentityResult> SetPhoneNumberAsync(TUser user, string phoneNumber);
Obviously I can't add methods for my own attributes like SetTagLineAsync... because this is a library class. I found it a little strange that they have such specific methods in a library but anyway I have the user object in context in my controller (which you can see above in the virtual methods) and I think I should be able to just update that object and call this method
public virtual Task<IdentityResult> UpdateAsync(TUser user);
And it'll update the user in the database to use the attributes I've set on the user. But this leads into my second question, because I'm not certain how this works yet I would want to try the above method and then go check in the database if it did update the attribute I wanted.
Second question: How do I view the projects database? There is obviously a database that was created with the project template and it is persistent because if I run the web app and register, when I run it again I can log in as that user. When I make a change to the ApplicationUser class I also have to add a migration and update the database through package manager console. I can see in my app settings
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-MyApp-3B07911E-A6DD-4B3E-A533-57B04E37B791;Trusted_Connection=True;MultipleActiveResultSets=true"
I don't have SQL server installed if that matters, just whatever sql stuff was installed with VS. In other projects i just go to Server Explorer and my database appears under Data Connections. I've tried to add the data connection but when I do, I add the server name (localdb) – i also tried without the brackets – and then when I try to select a database name it throws connection errors. I've also tried doing this while the webapp is open by disconnecting the debugger and trying the same process in case it only exists while it's running but same thing. Any ideas?