This question is locked. New answers and comments are not allowed.
Hi,
dbcontext.Refresh doesn't refresh/reset non-persistent properties of persistent class, how this can be done?
Example:
Class User
{
public string PersistentProperty1 {get;set;}
public string PersistentProperty2 {get;set;}
public string Non-PersistentProperty {get;set;}
}
var userObject = new User();
userObject.PersistentProperty1 = "Test";
userObject.PersistentProperty2 = "Test2";
userObject.Non-PersistentProperty = "Test3";
now if I call dbcontext.Refresh(userObject, OverwriteChangesFromStore);
only persistent properties are getting reset, non-persistent property is still set to "Test3".
How can I load complete userObject from DB, so that non-persistent property is set to string.empty or null?
Thanks