Прочитај на енглеском Уреди

Делите путем


ObjectIDGenerator.GetId(Object, Boolean) Method

Definition

Returns the ID for the specified object, generating a new ID if the specified object has not already been identified by the ObjectIDGenerator.

C#
public virtual long GetId(object obj, out bool firstTime);

Parameters

obj
Object

The object you want an ID for.

firstTime
Boolean

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

Returns

The object's ID is used for serialization. firstTime is set to true if this is the first time the object has been identified; otherwise, it is set to false.

Exceptions

The obj parameter is null.

The ObjectIDGenerator has been asked to keep track of too many objects.

Applies to

Производ Верзије
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1