Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Using ASP.NET Core MVC app tutorial with Authentication

$
0
0

Hello,

I'm using Visual Studio 2017 Community to follow this tutorial: https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/ and I included "Individual User Accounts Authentication" when I created the project.

 I got to the "Adding a Model" chapter and when I did the "Update the database" using the command prompt, it gave this error:

"More than one DbContext was found. Specify which one to use. Use the '-Context' parameter for PowerShell commands and the '--context' parameter for dotnet commands.".

So I used these commands to make it work: 

dotnet restore
dotnet ef migrations  add Initial -c MvcMovieContext
dotnet ef database update -c MvcMovieContext

I saved the solution just before running these command line commands.

I finished the "Adding a Model" chapter.

When I run the project, it runs fine and the user authentication works, except that there are two databases with the project.  One for the movie data and the other for the account authentication.

Is there someway to make these two databases into one database and have it so that the user has to login before using the movie database?

I would like to do that before I continue on to the "Working with SQL Server LocalDB" chapter.

Any help would be gratefully appreciated.

Thanks,
Tony


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>