Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EF7 migration in Pluralsight course

Is anyone else having problems with the second migration in Shawn Wildermuth's Pluralsight course "Building a Web App with ASP.NET Core RC1, MVC 6, EF7 & AngularJS"?

Specifically, the command

dnx ef migrations add IdentityEntities

causes this exception:

GenericArguments[0], 'TheWorld.Models.IWorldRepository', on 'Microsoft.Data.Entity.Infrastructure.IDbContextFactory`1[TContext]' violates the constraint of type 'TContext'.

The first migration and database creation seemed to go fine, so I'm not sure what's causing this.

like image 889
Paul Hennessey Avatar asked Dec 18 '22 17:12

Paul Hennessey


1 Answers

I just fixed this by deleting the entire Migrations folder from Solution Explorer. I am not sure exactly what causes this error, but I think if you name your migrations the same thing (IdentityEntities in your case) the problem is likely to occur.

like image 86
Brendan L Avatar answered Dec 29 '22 06:12

Brendan L