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
| Exception | Description |
| ArgumentNullException | Obj 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
Requirements
Platforms: Windows 2000, Windows XP family, Windows Server 2003 family, Windows Vista family
See Also