MongoDB.Bson.Serialization.IdGenerators.BsonBinaryDataGuidGenerator.IsEmpty C# (CSharp) Метод

IsEmpty() публичный Метод

Tests whether an Id is empty.
public IsEmpty ( object id ) : bool
id object The Id.
Результат bool
        public bool IsEmpty(object id)
        {
            if (id == null || ((BsonValue)id).IsBsonNull)
            {
                return true;
            }

            var idBsonBinaryData = (BsonBinaryData)id;
            var subType = idBsonBinaryData.SubType;
            if (subType != BsonBinarySubType.UuidLegacy && subType != BsonBinarySubType.UuidStandard)
            {
                throw new ArgumentOutOfRangeException("The binary sub type of the id value passed to the BsonBinaryDataGuidGenerator IsEmpty method is not UuidLegacy or UuidStandard.");
            }
            return idBsonBinaryData.Bytes.SequenceEqual(__emptyGuidBytes);
        }
    }