0

I already created a Asp.net core web api project and have created a database using identity with migration. Now I need to know, that can I add new table to the database and how can i do that? I'm new to this field.

I also have tried Add-Migration but giving me error. I have no idea about this.

The error message is:

An error occurred while accessing the IWebHost on class 'Program'. Continuing without the application service provider. Error: AddEntityFrameworkStores can only be called with a user that derives from IdentityUser. 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.

halfer
  • 19,824
  • 17
  • 99
  • 186
Ranto Berk
  • 351
  • 1
  • 3
  • 13
  • You've got 2 contexts so you need to parameterize your commands. See [here](https://stackoverflow.com/questions/21537558/multiple-db-contexts-in-the-same-db-and-application-in-ef-6-and-code-first-migra). – Steve Greene Jun 19 '19 at 20:30

1 Answers1

0

Create your model and add in DB context.

public DbSet<UserAttachment> UserAttachment {get; set;}

After that

add-migration 

And then

update-database
sudesh regmi
  • 536
  • 4
  • 12