System\Runtime\Serialization\ClassDataContract.cs (24)
160private Func<object> MakeNewInstance => _makeNewInstance ??= FastInvokerBuilder.GetMakeNewInstanceFunc(UnderlyingType);
167if (ci == null || UnderlyingType == Globals.TypeOfSchemaDefinedType)
190Debug.Assert(UnderlyingType != Globals.TypeOfSchemaDefinedType);
220Debug.Assert(UnderlyingType != Globals.TypeOfSchemaDefinedType);
408if (!IsTypeVisible(UnderlyingType))
414DataContract.GetClrTypeFullName(UnderlyingType)),
428DataContract.GetClrTypeFullName(UnderlyingType)),
440DataContract.GetClrTypeFullName(UnderlyingType)),
452DataContract.GetClrTypeFullName(UnderlyingType),
465DataContract.GetClrTypeFullName(UnderlyingType),
484DataContract.GetClrTypeFullName(UnderlyingType),
492DataContract.GetClrTypeFullName(UnderlyingType),
514if (!IsTypeVisible(UnderlyingType))
520DataContract.GetClrTypeFullName(UnderlyingType)),
535DataContract.GetClrTypeFullName(UnderlyingType),
548DataContract.GetClrTypeFullName(UnderlyingType),
567DataContract.GetClrTypeFullName(UnderlyingType),
575DataContract.GetClrTypeFullName(UnderlyingType),
764DataContract.GetClrTypeFullName(BaseClassContract.UnderlyingType),
1319Type type = UnderlyingType;
1341underlyingParamTypes[i] = paramContracts[i].UnderlyingType;
1356paramTypes[i] = paramContracts[paramType.GenericParameterPosition].UnderlyingType;
1368boundClassContract.XmlName = CreateQualifiedName(DataContract.ExpandGenericParameters(XmlConvert.DecodeName(xmlName.Name), new GenericNameProvider(DataContract.GetClrTypeFullName(UnderlyingType), genericParams)), xmlName.Namespace);
1507Type type = UnderlyingType;
System\Runtime\Serialization\CollectionDataContract.cs (14)
354if (UnderlyingType.IsInterface && (Kind == CollectionKind.Enumerable || Kind == CollectionKind.Collection || Kind == CollectionKind.GenericEnumerable))
356throw new InvalidDataContractException(SR.Format(SR.GetOnlyCollectionMustHaveAddMethod, GetClrTypeFullName(UnderlyingType)));
366throw new InvalidDataContractException(SR.Format(SR.GetOnlyCollectionMustHaveAddMethod, GetClrTypeFullName(UnderlyingType)));
1392Type type = UnderlyingType;
1397paramTypes[i] = paramContracts[paramTypes[i].GenericParameterPosition].UnderlyingType;
1409boundCollectionContract.XmlName = CreateQualifiedName(DataContract.ExpandGenericParameters(XmlConvert.DecodeName(XmlName.Name), new GenericNameProvider(DataContract.GetClrTypeFullName(UnderlyingType), paramContracts)),
1410IsCollectionDataContract(UnderlyingType) ? XmlName.Namespace : DataContract.GetCollectionNamespace(boundCollectionContract.ItemContract.XmlName.Namespace));
1431throw new InvalidDataContractException(SR.Format(SR.CollectionTypeDoesNotHaveDefaultCtor, DataContract.GetClrTypeFullName(UnderlyingType)));
1451if (!IsTypeVisible(UnderlyingType))
1457DataContract.GetClrTypeFullName(UnderlyingType)),
1479DataContract.GetClrTypeFullName(UnderlyingType)),
1490DataContract.GetClrTypeFullName(UnderlyingType),
1507if (!IsTypeVisible(UnderlyingType))
1513DataContract.GetClrTypeFullName(UnderlyingType)),
System\Runtime\Serialization\DataContract.cs (9)
99throw new SerializationException(SR.Format(SR.ErrorDeserializing, SR.Format(SR.ErrorTypeInfo, DataContract.GetClrTypeFullName(dataContract.UnderlyingType)), SR.Format(SR.NoSetMethodForProperty, string.Empty, string.Empty)));
178throw new InvalidDataContractException(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType)));
185throw new InvalidDataContractException(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType)));
192throw new InvalidDataContractException(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType)));
197throw new InvalidDataContractException(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType)));
406return (cachedContract != null && cachedContract.UnderlyingType == contract.UnderlyingType);
2086if (DataContractCriticalHelper.GetDataContractAdapterType(alreadyExistingContract.UnderlyingType) != DataContractCriticalHelper.GetDataContractAdapterType(type))
2087throw new InvalidOperationException(SR.Format(SR.DupContractInKnownTypes, type, alreadyExistingContract.UnderlyingType, dataContract.XmlName.Namespace, dataContract.XmlName.Name));
System\Runtime\Serialization\EnumDataContract.cs (6)
321throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.InvalidEnumValueOnWrite, value, DataContract.GetClrTypeFullName(UnderlyingType)));
327throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.InvalidEnumValueOnWrite, value, DataContract.GetClrTypeFullName(UnderlyingType)));
367throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.InvalidEnumValueOnRead, stringValue, DataContract.GetClrTypeFullName(UnderlyingType)));
372return Enum.ToObject(UnderlyingType, (object)(ulong)longValue);
373return Enum.ToObject(UnderlyingType, (object)longValue);
386throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.InvalidEnumValueOnRead, value.Substring(index, count), DataContract.GetClrTypeFullName(UnderlyingType)));
System\Runtime\Serialization\PrimitiveDataContract.cs (6)
69if (UnderlyingType.IsValueType)
70_helper.XmlFormatWriterMethod = typeof(XmlWriterDelegator).GetMethod(WriteMethodName, Globals.ScanAllMembers, new Type[] { UnderlyingType, typeof(XmlDictionaryString), typeof(XmlDictionaryString) })!;
72_helper.XmlFormatWriterMethod = typeof(XmlObjectSerializerWriteContext).GetMethod(WriteMethodName, Globals.ScanAllMembers, new Type[] { typeof(XmlWriterDelegator), UnderlyingType, typeof(XmlDictionaryString), typeof(XmlDictionaryString) })!;
85if (UnderlyingType.IsValueType)
86_helper.XmlFormatContentWriterMethod = typeof(XmlWriterDelegator).GetMethod(WriteMethodName, Globals.ScanAllMembers, new Type[] { UnderlyingType })!;
88_helper.XmlFormatContentWriterMethod = typeof(XmlObjectSerializerWriteContext).GetMethod(WriteMethodName, Globals.ScanAllMembers, new Type[] { typeof(XmlWriterDelegator), UnderlyingType })!;