You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UpdateGraph requires entity type to have a visible parameterless ctor. This is not needed by EF, a protected parameterless ctor does the job.
I think you could remove the new() constraint and use Activator.CreateInstance<T>()
The text was updated successfully, but these errors were encountered:
ghost
pushed a commit
that referenced
this issue
Aug 4, 2014
Activator.CreateInstance() doesn't work with a type that don't expose a public default ctor. My bad !
"Unhandled Exception: System.MissingMethodException: Default constructor not found for type ..."
Please, reopen this issue.
We could use the context to create entity Context.Set<T>().Create() It may create a proxy type I don't know if this is an issue... Or use (T)Activator.CreateInstance(typeof(T), nonPublic: true)
Hi,
UpdateGraph requires entity type to have a visible parameterless ctor. This is not needed by EF, a protected parameterless ctor does the job.
I think you could remove the
new()
constraint and useActivator.CreateInstance<T>()
The text was updated successfully, but these errors were encountered: