I'm just messing around with entity framework code first and come with this set up:
My DataContext implements the follow interface:
public interface IUnitOfWork
{
void Commit();
IDbSet<T> Set<T>() where T : class;
}
as You can see here: https://codereview.stackexchange.com/a/47904
then in my DataContext I implement:
public new IDbSet<T> Set<T>() where T : class
{
return this.Set<T>();
}
my Seed method:
protected override void Seed(DATACONTEXT context)
{
context.Set<ENTITY>().AddOrUpdate(p => p.PROPERTY , new ENTITY
{
PROPERTY = VALUE
});
}
when I run the migration I get an Exception from visual studio.
Is there something wrong with my code? or its just a bug from visual studio?