Value cannot be null. Parameter name: entitySet

I had the same issue and the cause was a POCO class that had a property of type Type.


Late to the game...but if it helps...

I had this same problem, everything was working fine, but this issue appeared, I added the following to one of my classes

public HttpPostedFileBase File { get; set; }

which seemed to break it.

I ensured I didn't map this to the database by using the following:

[NotMapped]
public HttpPostedFileBase File { get; set; }

You need to add the following using statement:

using System.ComponentModel.DataAnnotations.Schema;

Hope this helps