ObjectIDGenerator::HasId Method (Object^, Boolean%)
.NET Framework (current version)
Determines whether an object has already been assigned an ID.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- obj
-
Type:
System::Object^
The object you are asking for.
- firstTime
-
Type:
System::Boolean%
true if obj was not previously known to the ObjectIDGenerator; otherwise, false.
Return Value
Type: System::Int64The object ID of obj if previously known to the ObjectIDGenerator; otherwise, zero.
| Exception | Condition |
|---|---|
| ArgumentNullException | The obj parameter is null. |
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.
.NET Framework
Available since 1.1
Available since 1.1
Show: