Chili.Opf3 Send comments on this topic.
IsModified Method
See Also  Example
Chili.Opf3 Namespace > ObjectContext Class : IsModified Method




obj
Persistent objects that is checked for being modified.
Returns whether the object has been modified since the last operation.

Syntax

Visual Basic (Declaration) 
Public Function IsModified( _
   ByVal obj As Object _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As ObjectContext
Dim obj As Object
Dim value As Boolean
 
value = instance.IsModified(obj)
C# 
public bool IsModified( 
   object obj
)
Managed Extensions for C++ 
public: bool IsModified( 
   Object* obj
) 
C++/CLI 
public:
bool IsModified( 
   Object^ obj
) 

Parameters

obj
Persistent objects that is checked for being modified.

Exceptions

ExceptionDescription
ArgumentNullExceptionObj is null.

Example

The following example shows how to use this method.
C#Copy Code
// Load the object from the storage. 
User user = context.GetObject<User>("Id = {0}", "1"); 
 
// Set a new name for the user object. 
user.Name = "new Name"; 
 
// Check if the object has been modified. 
if (context.IsModified<User>(user)) 
    Console.WriteLine("Object has been changed."); 
 
   

Remarks

Validates the data of the object set as parameter and returns whether the object has been modified since the last operation. The last operation is the last insert, load, update on the object.

Requirements

Platforms: Windows 2000, Windows XP family, Windows Server 2003 family, Windows Vista family

See Also