ObjectIDGenerator.HasId(Object, Boolean) Method

Definition

Determines whether an object has already been assigned an ID.

public:
 virtual long HasId(System::Object ^ obj, [Runtime::InteropServices::Out] bool % firstTime);
public virtual long HasId (object obj, out bool firstTime);
abstract member HasId : obj * bool -> int64
override this.HasId : obj * bool -> int64
Public Overridable Function HasId (obj As Object, ByRef firstTime As Boolean) As Long

Parameters

obj
Object

The object you are asking for.

firstTime
Boolean

true if obj was not previously known to the ObjectIDGenerator; otherwise, false.

Returns

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

Exceptions

The obj parameter is null.

Remarks

If the object has already been assigned an ID, the ID is returned and firstTime is set to false; otherwise, zero is returned and firstTime is set to true. HasId differs from GetId in that it never creates an ID for an object that has not already been seen by the ObjectIDGenerator.

Applies to