Checks to see if an object has already been assigned an ID.
[Visual Basic] Overridable Public Function HasId( _ ByVal obj As Object, _ ByRef firstTime As Boolean _ ) As Long [C#] public virtual long HasId( object obj, ref bool firstTime ); [C++] public: virtual __int64 HasId( Object* obj, bool** firstTime ); [JScript] public function HasId( obj : Object, firstTime : Boolean ) : long;
The object ID of obj if previously known to the ObjectIDGenerator, otherwise zero.
Exception Type | Condition |
---|---|
ArgumentNullException | The obj parameter is a null reference (in Visual Basic Nothing). |
If the object has already been assigned an ID, that ID is returned and firstTime set to false; otherwise, zero is returned and firstTime set to true. Note that HasId differs from GetId in that it never creates an ID for an object that has not been already seen by the ObjectIDGenerator in its lifetime.
ObjectIDGenerator Class | ObjectIDGenerator Members | System.Runtime.Serialization Namespace