NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ObjectIDGenerator.HasId

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;

Parameters

obj
The object for which we are asking.
firstTime
Set to true if obj was not previously known to the ObjectIDGenerator; otherwise, false.

Return Value

The object ID of obj if previously known to the ObjectIDGenerator, otherwise zero.

Exceptions

Exception Type Condition
ArgumentNullException The obj parameter is a null reference (in Visual Basic Nothing).

Remarks

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.

See Also

ObjectIDGenerator Class | ObjectIDGenerator Members | System.Runtime.Serialization Namespace