The entity type <type> is not part of the model for the current context.

Dec 17, 2013 at 7:52 PM
Edited Dec 18, 2013 at 12:01 PM
Added an issue
Jan 28, 2014 at 6:29 PM
When I got this error I resolved it by creating an EntityTypeConfiguration for the model. It seems that is the only prerequisite to using the repository, you have to create one and then load it in the context.

public class MyTypeConfiguration : EntityTypeConfiguration<Models.MyType>
{
        public MyTypeConfiguration()
        {
            ToTable("MyType");
        }
}
then put this in your context..
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
            base.OnModelCreating(modelBuilder);

            // model binding configurations
            modelBuilder.Configurations
                         .Add(new MyTypeConfiguration())
}
Marked as answer by lelong37 on 3/31/2014 at 10:38 PM