I am developing an application using the EF4 and created a generic method, but generating this error.
Method:
public Boolean change (T)
{
ctx.ApplyCurrentValues <T> (t.GetType (). Name, t);
return save ();
}
And the error that is gerendo is this:
An object with a key that matches the key of the supplied object could not be found in the ObjectStateManager. Verify that the key values of the supplied object match the key values of the object to which changes must be applied.
Does anyone know how to solve this problem?