RejectPropertyChanges Method

ObjectStateEntry.RejectPropertyChanges Method (String)

.NET Framework (current version)
 

Rejects any changes made to the property with the given name since the property was last loaded, attached, saved, or changes were accepted. The orginal value of the property is stored and the property will no longer be marked as modified.

Namespace:   System.Data.Objects
Assembly:  System.Data.Entity (in System.Data.Entity.dll)

public abstract void RejectPropertyChanges(
	string propertyName
)

Parameters

propertyName
Type: System.String

The name of the property to change.

If the result is that no properties of the entity are marked as modified, then the entity will be marked as Unchanged. Changes to properties can only rejected for entities that are in the Modified or Unchanged state. Calling this method for entities in other states (Added, Deleted, or Detached) will result in an exception being thrown. Rejecting changes to properties of an Unchanged entity or unchanged properties of a Modifed is a no-op.

.NET Framework
Available since 4.5
Return to top
Show:
© 2016 Microsoft