The entity type Object is not part of the model for the current context
问题 I'm creating an object in this way: var assembly = typeof (Cliente).Assembly; var Tipo = assembly.GetType("Datos." + tipoItem); var item = Activator.CreateInstance(Tipo); where tipoItem is the name of a class and Datos is the respective namespace. Cliente is a class in the same namespace. To store the object in the database I have this generic method: public void AddItem<TItem>(TItem item) where TItem : class { db.Set<TItem>().Add(item); db.SaveChanges(); } When debugging, the type of the