System.Xml.Serialization.XmlReflectionImporter.CheckNullable C# (CSharp) Method

CheckNullable() private static method

private static CheckNullable ( bool isNullable, TypeDesc typeDesc, TypeMapping mapping ) : void
isNullable bool
typeDesc TypeDesc
mapping TypeMapping
return void
        private static void CheckNullable(bool isNullable, TypeDesc typeDesc, TypeMapping mapping)
        {
            if (mapping is NullableMapping) return;
            if (mapping is SerializableMapping) return;
            if (isNullable && !typeDesc.IsNullable) throw new InvalidOperationException(SR.Format(SR.XmlInvalidIsNullable, typeDesc.FullName));
        }