Wednesday, March 7, 2018

MVC app: How do I create an app that connects users with user-specific data?

I'm currently building a MVC app that's similar to a library portal. The user can log into their account and check out books or see the books they've checked out. Right now I have two databases: One is the DefaultConnection where AspNetUsers table is being used for user info. The other database is the one I built to keep track of all the checkouts, the books, etc.

I'm having trouble remembering how to make the connection between a user and the books they check out, and I'm struggling to figure out the exact phrasing to google the answer to this question. I figure that I will need a foreign key to link the user table to the checkout table, but I cannot do this when the tables are in separate databases. So I also figure that means that I need to move my user table into the database that I actually built.

Once I create a new users table and add a foreign key, is this as simple as changing the connection string? Or are there other changes I need to make? Am I making this more complicated than it needs to be?

MVC app: How do I create an app that connects users with user-specific data? Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team