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

Many-To-Many Relationship in DotNet Core 2

$
0
0

Hello.

I was searching for many to many relationship in EF Core 2 and i find this microsoft doc page :

https://docs.microsoft.com/en-us/ef/core/modeling/relationships

but When i am trying to run dotnet ef migrations add "Init" with my project (my db context inherits from IdentityDbContext<User>) i get error like this :

An error occurred while calling method 'BuildWebHost' on class 'Program'. Continuing without the application service provider. Error: The entity type 'MyPost' requires a primary key to be defined.

Unable to create an object of type 'BlogDbContext'. Add an implementation of 'IDesignTimeDbContextFactory<BlogDbContext>' to the project, or see https://go.microsoft.com/fwlink/?linkid=851728 for additional patterns supported at design time.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



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