System\Runtime\Serialization\ClassDataContract.cs (24)
159private Func<object> MakeNewInstance => _makeNewInstance ??= FastInvokerBuilder.GetMakeNewInstanceFunc(UnderlyingType);
166if (ci == null || UnderlyingType == Globals.TypeOfSchemaDefinedType)
189Debug.Assert(UnderlyingType != Globals.TypeOfSchemaDefinedType);
219Debug.Assert(UnderlyingType != Globals.TypeOfSchemaDefinedType);
407if (!IsTypeVisible(UnderlyingType))
413DataContract.GetClrTypeFullName(UnderlyingType)),
427DataContract.GetClrTypeFullName(UnderlyingType)),
439DataContract.GetClrTypeFullName(UnderlyingType)),
451DataContract.GetClrTypeFullName(UnderlyingType),
464DataContract.GetClrTypeFullName(UnderlyingType),
483DataContract.GetClrTypeFullName(UnderlyingType),
491DataContract.GetClrTypeFullName(UnderlyingType),
513if (!IsTypeVisible(UnderlyingType))
519DataContract.GetClrTypeFullName(UnderlyingType)),
534DataContract.GetClrTypeFullName(UnderlyingType),
547DataContract.GetClrTypeFullName(UnderlyingType),
566DataContract.GetClrTypeFullName(UnderlyingType),
574DataContract.GetClrTypeFullName(UnderlyingType),
761DataContract.GetClrTypeFullName(BaseClassContract.UnderlyingType),
1316Type type = UnderlyingType;
1338underlyingParamTypes[i] = paramContracts[i].UnderlyingType;
1353paramTypes[i] = paramContracts[paramType.GenericParameterPosition].UnderlyingType;
1365boundClassContract.XmlName = CreateQualifiedName(DataContract.ExpandGenericParameters(XmlConvert.DecodeName(xmlName.Name), new GenericNameProvider(DataContract.GetClrTypeFullName(UnderlyingType), genericParams)), xmlName.Namespace);
1504Type type = UnderlyingType;
System\Runtime\Serialization\CollectionDataContract.cs (14)
353if (UnderlyingType.IsInterface && (Kind == CollectionKind.Enumerable || Kind == CollectionKind.Collection || Kind == CollectionKind.GenericEnumerable))
355throw new InvalidDataContractException(SR.Format(SR.GetOnlyCollectionMustHaveAddMethod, GetClrTypeFullName(UnderlyingType)));
365throw new InvalidDataContractException(SR.Format(SR.GetOnlyCollectionMustHaveAddMethod, GetClrTypeFullName(UnderlyingType)));
1388Type type = UnderlyingType;
1393paramTypes[i] = paramContracts[paramTypes[i].GenericParameterPosition].UnderlyingType;
1405boundCollectionContract.XmlName = CreateQualifiedName(DataContract.ExpandGenericParameters(XmlConvert.DecodeName(XmlName.Name), new GenericNameProvider(DataContract.GetClrTypeFullName(UnderlyingType), paramContracts)),
1406IsCollectionDataContract(UnderlyingType) ? XmlName.Namespace : DataContract.GetCollectionNamespace(boundCollectionContract.ItemContract.XmlName.Namespace));
1427throw new InvalidDataContractException(SR.Format(SR.CollectionTypeDoesNotHaveDefaultCtor, DataContract.GetClrTypeFullName(UnderlyingType)));
1447if (!IsTypeVisible(UnderlyingType))
1453DataContract.GetClrTypeFullName(UnderlyingType)),
1475DataContract.GetClrTypeFullName(UnderlyingType)),
1486DataContract.GetClrTypeFullName(UnderlyingType),
1503if (!IsTypeVisible(UnderlyingType))
1509DataContract.GetClrTypeFullName(UnderlyingType)),
System\Runtime\Serialization\DataContract.cs (9)
92throw new SerializationException(SR.Format(SR.ErrorDeserializing, SR.Format(SR.ErrorTypeInfo, DataContract.GetClrTypeFullName(dataContract.UnderlyingType)), SR.Format(SR.NoSetMethodForProperty, string.Empty, string.Empty)));
171throw new InvalidDataContractException(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType)));
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)));
190throw new InvalidDataContractException(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType)));
388return (cachedContract != null && cachedContract.UnderlyingType == contract.UnderlyingType);
2060if (DataContractCriticalHelper.GetDataContractAdapterType(alreadyExistingContract.UnderlyingType) != DataContractCriticalHelper.GetDataContractAdapterType(type))
2061throw 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 })!;