System.Security.Claims.ClaimsIdentity.GetObjectData C# (CSharp) Method

GetObjectData() protected method

Populates the specified SerializationInfo with the serialization data for the ClaimsIdentity
Thrown if the info parameter is null.
protected GetObjectData ( SerializationInfo info, StreamingContext context ) : void
info SerializationInfo The serialization information stream to write to. Satisfies ISerializable contract.
context StreamingContext Context for serialization. Can be null.
return void
        protected virtual void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            if (null == info)
            {
                throw new ArgumentNullException(nameof(info));
            }

            const string Version = "1.0";
            info.AddValue(VersionKey, Version);
            if (!string.IsNullOrEmpty(_authenticationType))
            {
                info.AddValue(AuthenticationTypeKey, _authenticationType);
            }

            info.AddValue(NameClaimTypeKey, _nameClaimType);
            info.AddValue(RoleClaimTypeKey, _roleClaimType);

            if (!string.IsNullOrEmpty(_label))
            {
                info.AddValue(LabelKey, _label);
            }

            // actor
            if (_actor != null || _bootstrapContext != null || (_instanceClaims != null && _instanceClaims.Count > 0))
            {
                throw new PlatformNotSupportedException(SR.PlatformNotSupported_Serialization); // BinaryFormatter needed
            }
        }

Same methods

ClaimsIdentity::GetObjectData ( System info, System context ) : void