7 types derived from DataContract
System.Private.DataContractSerialization (7)
System\Runtime\Serialization\ClassDataContract.cs (1)
19internal sealed class ClassDataContract : DataContract
System\Runtime\Serialization\CollectionDataContract.cs (1)
70internal sealed class CollectionDataContract : DataContract
System\Runtime\Serialization\EnumDataContract.cs (1)
16internal sealed class EnumDataContract : DataContract
System\Runtime\Serialization\GenericParameterDataContract.cs (1)
10internal sealed class GenericParameterDataContract : DataContract
System\Runtime\Serialization\PrimitiveDataContract.cs (1)
14internal abstract class PrimitiveDataContract : DataContract
System\Runtime\Serialization\SpecialTypeDataContract.cs (1)
9internal sealed class SpecialTypeDataContract : DataContract
System\Runtime\Serialization\XmlDataContract.cs (1)
21public sealed class XmlDataContract : DataContract
2132 references to DataContract
System.Private.DataContractSerialization (2064)
System\Runtime\Serialization\AccessorBuilder.cs (3)
29[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 91throw new InvalidOperationException(SR.Format(SR.InvalidMember, DataContract.GetClrTypeFullName(memberInfo.DeclaringType!), memberInfo.Name)); 155throw new InvalidOperationException(SR.Format(SR.InvalidMember, DataContract.GetClrTypeFullName(memberInfo.DeclaringType!), memberInfo.Name));
System\Runtime\Serialization\ClassDataContract.cs (116)
15using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, System.Runtime.Serialization.DataContracts.DataContract>; 34[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 35[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 41[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 42[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 57public override DataContract? BaseContract 59[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 60[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 80[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 81[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 116[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 117[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 162[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 185[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 186[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 195[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 196[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 215[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 216[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 225[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 226[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 249[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 250[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 261DataContract.ThrowInvalidDataContractException( 265DataContract.GetClrTypeFullName(declaringType), 273[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 274[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 275internal static XmlDictionaryString? GetChildNamespaceToDeclare(DataContract dataContract, Type childType, XmlDictionary dictionary) 277childType = DataContract.UnwrapNullableType(childType); 279&& DataContract.GetBuiltInDataContract(childType) == null && childType != Globals.TypeOfDBNull) 281string ns = DataContract.GetXmlName(childType).Namespace; 352[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 353[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 381[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 382[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 389[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 390[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 413DataContract.GetClrTypeFullName(UnderlyingType)), 427DataContract.GetClrTypeFullName(UnderlyingType)), 439DataContract.GetClrTypeFullName(UnderlyingType)), 451DataContract.GetClrTypeFullName(UnderlyingType), 464DataContract.GetClrTypeFullName(UnderlyingType), 483DataContract.GetClrTypeFullName(UnderlyingType), 491DataContract.GetClrTypeFullName(UnderlyingType), 519DataContract.GetClrTypeFullName(UnderlyingType)), 534DataContract.GetClrTypeFullName(UnderlyingType), 547DataContract.GetClrTypeFullName(UnderlyingType), 566DataContract.GetClrTypeFullName(UnderlyingType), 574DataContract.GetClrTypeFullName(UnderlyingType), 587private sealed class ClassDataContractCriticalHelper : DataContract.DataContractCriticalHelper 616[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 617[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 639throw new InvalidDataContractException(SR.Format(SR.ISerializableCannotHaveDataContract, DataContract.GetClrTypeFullName(type))); 648DataContract baseContract = DataContract.GetDataContract(baseType); 661DataContract.GetClrTypeFullName(type), DataContract.GetClrTypeFullName(baseType))); 672throw new InvalidDataContractException(SR.Format(SR.OnlyDataContractTypesCanHaveExtensionData, DataContract.GetClrTypeFullName(type))); 721[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 722[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 757DataContract.ThrowInvalidDataContractException( 759DataContract.GetClrTypeFullName(type), 761DataContract.GetClrTypeFullName(BaseClassContract.UnderlyingType), 783DataContract.ThrowInvalidDataContractException( 785DataContract.GetClrTypeFullName(type), 797[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 798[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 826ThrowInvalidDataContractException(SR.Format(SR.TooManyDataMembers, DataContract.GetClrTypeFullName(member.DeclaringType!), member.Name)); 851ThrowInvalidDataContractException(SR.Format(SR.InvalidMember, DataContract.GetClrTypeFullName(type), member.Name)); 857ThrowInvalidDataContractException(SR.Format(SR.InvalidDataMemberName, member.Name, DataContract.GetClrTypeFullName(type))); 863memberContract.Name = DataContract.EncodeLocalName(memberContract.Name); 864memberContract.IsNullable = DataContract.IsTypeNullable(memberContract.MemberType); 870DataContract.GetClrTypeFullName(member.DeclaringType!), 889ThrowInvalidDataContractException(SR.Format(SR.TooManyIgnoreDataMemberAttributes, DataContract.GetClrTypeFullName(member.DeclaringType!), member.Name)); 918memberContract.Name = DataContract.EncodeLocalName(member.Name); 919memberContract.IsNullable = DataContract.IsTypeNullable(memberContract.MemberType); 932memberContract.Name = DataContract.EncodeLocalName(member.Name); 940DataContract.GetClrTypeFullName(member.DeclaringType!), 945memberContract.IsNullable = DataContract.IsTypeNullable(memberContract.MemberType); 960[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 961[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1035[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1036[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1039return DataContract.GetXmlName(type, out _hasDataContract); 1108ThrowInvalidDataContractException(SR.Format(SR.DuplicateExtensionDataSetMethod, method, _extensionDataSetMethod, DataContract.GetClrTypeFullName(method.DeclaringType))); 1110DataContract.ThrowInvalidDataContractException(SR.Format(SR.ExtensionDataSetMustReturnVoid, DataContract.GetClrTypeFullName(method.DeclaringType), method), method.DeclaringType); 1112DataContract.ThrowInvalidDataContractException(SR.Format(SR.ExtensionDataSetParameterInvalid, DataContract.GetClrTypeFullName(method.DeclaringType), method, Globals.TypeOfExtensionDataObject), method.DeclaringType); 1125DataContract.ThrowInvalidDataContractException(SR.Format(SR.DuplicateCallback, method, currentCallback, DataContract.GetClrTypeFullName(method.DeclaringType), attributeType), method.DeclaringType); 1127DataContract.ThrowInvalidDataContractException(SR.Format(SR.DuplicateAttribute, prevAttributeType, attributeType, DataContract.GetClrTypeFullName(method.DeclaringType), method), method.DeclaringType); 1129DataContract.ThrowInvalidDataContractException(SR.Format(SR.CallbacksCannotBeVirtualMethods, method, DataContract.GetClrTypeFullName(method.DeclaringType), attributeType), method.DeclaringType); 1133DataContract.ThrowInvalidDataContractException(SR.Format(SR.CallbackMustReturnVoid, DataContract.GetClrTypeFullName(method.DeclaringType), method), method.DeclaringType); 1135DataContract.ThrowInvalidDataContractException(SR.Format(SR.CallbackParameterInvalid, DataContract.GetClrTypeFullName(method.DeclaringType), method, Globals.TypeOfStreamingContext), method.DeclaringType); 1208[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1209[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1218_knownDataContracts = DataContract.ImportKnownTypeAttributes(UnderlyingType); 1250throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.SerializationInfo_ConstructorNotFound, DataContract.GetClrTypeFullName(UnderlyingType))); 1267throw new InvalidDataContractException(SR.Format(SR.NonAttributedSerializableTypesMustHaveDefaultConstructor, DataContract.GetClrTypeFullName(type))); 1312[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1313[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1314internal override DataContract BindGenericParameters(DataContract[] paramContracts, Dictionary<DataContract, DataContract>? boundContracts = null) 1322if (boundContracts != null && boundContracts.TryGetValue(this, out DataContract? boundContract)) 1344xmlName = DataContract.GetXmlName(type.GetGenericTypeDefinition()); 1363boundContracts ??= new Dictionary<DataContract, DataContract>(); 1365boundClassContract.XmlName = CreateQualifiedName(DataContract.ExpandGenericParameters(XmlConvert.DecodeName(xmlName.Name), new GenericNameProvider(DataContract.GetClrTypeFullName(UnderlyingType), genericParams)), xmlName.Namespace);
System\Runtime\Serialization\CodeGenerator.cs (11)
120[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 132[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 696throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.CanOnlyStoreIntoArgOrLocGot0, DataContract.GetClrTypeFullName(var.GetType()))); 853throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.UnknownConstantType, DataContract.GetClrTypeFullName(valueType))); 992throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.ArrayTypeIsNotSupported_GeneratingCode, DataContract.GetClrTypeFullName(arrayElementType))); 1030throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.ArrayTypeIsNotSupported_GeneratingCode, DataContract.GetClrTypeFullName(arrayElementType))); 1160throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.NoConversionPossibleTo, DataContract.GetClrTypeFullName(target))); 1173throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.IsNotAssignableFrom, DataContract.GetClrTypeFullName(target), DataContract.GetClrTypeFullName(source))); 1193throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.IsNotAssignableFrom, DataContract.GetClrTypeFullName(target), DataContract.GetClrTypeFullName(source)));
System\Runtime\Serialization\CollectionDataContract.cs (152)
15using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, System.Runtime.Serialization.DataContracts.DataContract>; 79private DataContract? _itemContract; 83[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 84[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 90[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 91[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 92internal CollectionDataContract(Type type, DataContract itemContract) : base(new CollectionDataContractCriticalHelper(type, itemContract)) 97[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 98[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 104[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 105[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 112[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 113[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 120[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 121[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 128[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 129[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 137[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 138[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 139private void InitCollectionDataContract(DataContract? sharedTypeContract) 156internal DataContract ItemContract 158[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 159[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 169internal DataContract? SharedTypeContract => _helper.SharedTypeContract; 199public override DataContract BaseContract 201[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 202[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 210[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 211[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 254[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 255[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 270[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 271[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 279[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 280[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 299[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 300[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 308[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 309[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 333[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 334[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 343[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 344[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 381[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 387[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 393[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 394[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 400private sealed class CollectionDataContractCriticalHelper : DataContract.DataContractCriticalHelper 412private DataContract? _itemContract; 413private DataContract? _sharedTypeContract; 442[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 443[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 450_isItemTypeNullable = DataContract.IsTypeNullable(itemType); 459throw new InvalidDataContractException(SR.Format(SR.InvalidCollectionContractItemName, DataContract.GetClrTypeFullName(UnderlyingType))); 460itemName = DataContract.EncodeLocalName(collectionContractAttribute.ItemName); 466throw new InvalidDataContractException(SR.Format(SR.InvalidCollectionContractKeyName, DataContract.GetClrTypeFullName(UnderlyingType))); 468throw new InvalidDataContractException(SR.Format(SR.InvalidCollectionContractKeyNoDictionary, DataContract.GetClrTypeFullName(UnderlyingType), collectionContractAttribute.KeyName)); 469keyName = DataContract.EncodeLocalName(collectionContractAttribute.KeyName); 474throw new InvalidDataContractException(SR.Format(SR.InvalidCollectionContractValueName, DataContract.GetClrTypeFullName(UnderlyingType))); 476throw new InvalidDataContractException(SR.Format(SR.InvalidCollectionContractValueNoDictionary, DataContract.GetClrTypeFullName(UnderlyingType), collectionContractAttribute.ValueName)); 477valueName = DataContract.EncodeLocalName(collectionContractAttribute.ValueName); 484_itemName = itemName ?? DataContract.GetXmlName(DataContract.UnwrapNullableType(itemType)).Name; 498[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 499[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 508XmlName = DataContract.GetXmlName(type); 512[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 513[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 519XmlName = DataContract.GetXmlName(type); 524[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 525[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 529DataContract itemContract) : base(type) 539[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 540[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 553XmlName = DataContract.GetCollectionXmlName(type, itemType, out collectionContractAttribute); 562[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 563[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 571throw new InvalidDataContractException(SR.Format(SR.CollectionMustHaveAddMethod, DataContract.GetClrTypeFullName(type))); 578[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 579[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 586[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 587[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 601internal DataContract ItemContract 603[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 604[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 613DataContract.ThrowInvalidDataContractException( 614SR.Format(SR.DupKeyValueName, DataContract.GetClrTypeFullName(UnderlyingType), KeyName), 621DataContract.GetDataContract(ItemType); 625_itemContract = DataContract.GetDataContract(ItemType); 636internal DataContract? SharedTypeContract 694[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 695[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 704_knownDataContracts = DataContract.ImportKnownTypeAttributes(UnderlyingType); 746[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 790[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 812[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 839[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 840[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 908[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 909[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 910private DataContract? GetSharedTypeContract(Type type) 932[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 933[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 939[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 940[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 946[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 947[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 953[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 954[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 957if (type.IsArray && DataContract.GetBuiltInDataContract(type) == null) 965[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 966[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 967internal static bool TryCreate(Type type, [NotNullWhen(true)] out DataContract? dataContract) 972[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 973[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 974internal static bool TryCreateGetOnlyCollectionDataContract(Type type, [NotNullWhen(true)] out DataContract? dataContract) 1005[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1006[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1007private static bool IsCollectionOrTryCreate(Type type, bool tryCreate, out DataContract? dataContract, out Type itemType, bool constructorRequired, bool skipIfReadOnlyContract = false) 1012if (DataContract.GetBuiltInDataContract(type) != null) 1180SR.CollectionTypeDoesNotHaveAddMethod, DataContract.GetClrTypeFullName(itemType), ref dataContract); 1186GetReadOnlyCollectionExceptionMessages(type, hasCollectionDataContract, SR.CollectionTypeDoesNotHaveAddMethod, DataContract.GetClrTypeFullName(itemType), out serializationExceptionMessage, out deserializationExceptionMessage); 1251[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1252[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1253private static bool HandleIfInvalidCollection(Type type, bool tryCreate, bool hasCollectionDataContract, bool createContractWithException, string message, string? param, ref DataContract? dataContract) 1258throw new InvalidDataContractException(GetInvalidCollectionMessage(message, SR.Format(SR.InvalidCollectionDataContract, DataContract.GetClrTypeFullName(type)), param)); 1265dataContract = new CollectionDataContract(type, GetInvalidCollectionMessage(message, SR.Format(SR.InvalidCollectionType, DataContract.GetClrTypeFullName(type)), param)); 1301[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1377[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1378[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1379internal override DataContract BindGenericParameters(DataContract[] paramContracts, Dictionary<DataContract, DataContract>? boundContracts = null) 1381DataContract boundContract; 1398boundContracts ??= new Dictionary<DataContract, DataContract>(); 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)); 1410internal override DataContract GetValidContract(bool verifyConstructor = false) 1427throw new InvalidDataContractException(SR.Format(SR.CollectionTypeDoesNotHaveDefaultCtor, DataContract.GetClrTypeFullName(UnderlyingType))); 1453DataContract.GetClrTypeFullName(UnderlyingType)), 1464DataContract.GetClrTypeFullName(ItemType)), 1475DataContract.GetClrTypeFullName(UnderlyingType)), 1486DataContract.GetClrTypeFullName(UnderlyingType), 1509DataContract.GetClrTypeFullName(UnderlyingType)), 1520DataContract.GetClrTypeFullName(ItemType)), 1554[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1555[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1565[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1566[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\ContextAware.cs (12)
16private (DataContract? strong, WeakReference<DataContract>? weak)[] _contracts; 17private ConditionalWeakTable<Type, DataContract> _keepAlive; 23_contracts = new (DataContract?, WeakReference<DataContract>?)[size]; 24_keepAlive = new ConditionalWeakTable<Type, DataContract>(); 27public DataContract? GetItem(int index) => _contracts[index].strong ?? (_contracts[index].weak?.TryGetTarget(out DataContract? ret) == true ? ret : null); 29public void SetItem(int index, DataContract dataContract) 39_contracts[index].weak = new WeakReference<DataContract>(dataContract); 46Array.Resize<(DataContract?, WeakReference<DataContract>?)>(ref _contracts, newSize);
System\Runtime\Serialization\DataContract.cs (230)
20using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, System.Runtime.Serialization.DataContracts.DataContract>; 53[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 54[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 55internal static DataContract GetDataContract(Type type) 60[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 61[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 62internal static DataContract GetDataContract(RuntimeTypeHandle typeHandle) 65DataContract dataContract = GetDataContractSkipValidation(id, typeHandle, null); 69[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 70[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 71internal static DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle) 73DataContract dataContract = GetDataContractSkipValidation(id, typeHandle, null); 77[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 78[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 79internal static DataContract GetDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type? type) 84[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 85[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 86internal static DataContract GetGetOnlyCollectionDataContract(int id, RuntimeTypeHandle typeHandle, Type? type) 88DataContract dataContract = GetGetOnlyCollectionDataContractSkipValidation(id, typeHandle, type); 92throw new SerializationException(SR.Format(SR.ErrorDeserializing, SR.Format(SR.ErrorTypeInfo, DataContract.GetClrTypeFullName(dataContract.UnderlyingType)), SR.Format(SR.NoSetMethodForProperty, string.Empty, string.Empty))); 97[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 98[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 99internal static DataContract GetGetOnlyCollectionDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type? type) 104internal static DataContract GetDataContractForInitialization(int id) 119[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 120[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 121internal static DataContract? GetBuiltInDataContract(Type type) 126[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 127[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 128public static DataContract? GetBuiltInDataContract(string name, string ns) 133[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 134[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 135internal static DataContract? GetBuiltInDataContract(string typeName) 167[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 168[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 171throw new InvalidDataContractException(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType))); 174[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 175[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 178throw new InvalidDataContractException(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType))); 181[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 182[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 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))); 211public virtual DataContract? BaseContract 213[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 214[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 220[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 221[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 228[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 229[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 282[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 283[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 284internal virtual DataContract BindGenericParameters(DataContract[] paramContracts, Dictionary<DataContract, DataContract>? boundContracts = null) 289internal virtual DataContract GetValidContract(bool verifyConstructor = false) 304private static readonly ContextAwareDictionary<Type, DataContract?> s_typeToBuiltInContract = new(); 305private static Dictionary<XmlQualifiedName, DataContract?>? s_nameToBuiltInContract; 306private static Dictionary<string, DataContract?>? s_typeNameToBuiltInContract; 334[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 335[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 336internal static DataContract GetDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type? type) 338DataContract? dataContract = s_dataContractCache.GetItem(id); 350[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 351[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 352internal static DataContract GetGetOnlyCollectionDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type? type) 354DataContract dataContract = s_dataContractCache.GetItem(id) ?? CreateGetOnlyCollectionDataContract(id, typeHandle, type); 358internal static DataContract GetDataContractForInitialization(int id) 360DataContract? dataContract = s_dataContractCache.GetItem(id); 370int id = DataContract.GetId(classContract.TypeForInitialization.TypeHandle); 386private static bool ContractMatches(DataContract contract, DataContract? cachedContract) 426[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 427[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 428private static DataContract CreateDataContract(int id, RuntimeTypeHandle typeHandle, Type? type) 430DataContract? dataContract = s_dataContractCache.GetItem(id); 448[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 449[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 450private static DataContract CreateDataContract(Type type) 456DataContract? dataContract = GetBuiltInDataContract(type); 498private static void AssignDataContractToId(DataContract dataContract, int id) 506[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 507[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 508private static DataContract CreateGetOnlyCollectionDataContract(int id, RuntimeTypeHandle typeHandle, Type? type) 510DataContract? dataContract = null; 531[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 532[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 576[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 577[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 578internal static DataContract? GetBuiltInDataContract(Type type) 585TryCreateBuiltInDataContract(key, out DataContract? dataContract); 590[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 591[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 592internal static DataContract? GetBuiltInDataContract(string name, string ns) 596s_nameToBuiltInContract ??= new Dictionary<XmlQualifiedName, DataContract?>(); 599if (!s_nameToBuiltInContract.TryGetValue(qname, out DataContract? dataContract)) 610[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 611[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 612internal static DataContract? GetBuiltInDataContract(string typeName) 619s_typeNameToBuiltInContract ??= new Dictionary<string, DataContract?>(); 621if (!s_typeNameToBuiltInContract.TryGetValue(typeName, out DataContract? dataContract)) 663[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 664[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 665internal static bool TryCreateBuiltInDataContract(Type type, [NotNullWhen(true)] out DataContract? dataContract) 746[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 747[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 748internal static bool TryCreateBuiltInDataContract(string name, string ns, [NotNullWhen(true)] out DataContract? dataContract) 994[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 995[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1085[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1086[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1092[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1093[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1119return DataContract.GetBuiltInDataContract(type) != null || 1218[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1219[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1225[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1226[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1232[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1233[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1258[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1259[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1267throw new InvalidDataContractException(SR.Format(SR.InvalidDataContractName, DataContract.GetClrTypeFullName(type))); 1270name = DataContract.EncodeLocalName(name); 1279throw new InvalidDataContractException(SR.Format(SR.InvalidDataContractNamespace, DataContract.GetClrTypeFullName(type))); 1288[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1289[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1313[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1314[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1319DataContract? builtInContract = GetBuiltInDataContract(type); 1347throw new InvalidDataContractException(SR.Format(SR.TooManyDataContracts, DataContract.GetClrTypeFullName(type))); 1355[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1356[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1362[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1363[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1372throw new InvalidDataContractException(SR.Format(SR.TooManyCollectionContracts, DataContract.GetClrTypeFullName(type))); 1379throw new InvalidDataContractException(SR.Format(SR.InvalidCollectionContractName, DataContract.GetClrTypeFullName(type))); 1382name = DataContract.EncodeLocalName(name); 1391throw new InvalidDataContractException(SR.Format(SR.InvalidCollectionContractNamespace, DataContract.GetClrTypeFullName(type))); 1408[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1409[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1415if (DataContract.GetBuiltInDataContract(itemType) != null) 1428[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1429[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1435GenericInfo genericInfo = new GenericInfo(DataContract.GetXmlName(Globals.TypeOfNullable), Globals.TypeOfNullable.FullName!); 1449[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1450[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1456[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1457[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1473typeName = DataContract.GetClrTypeFullName(type).Substring(nsLen).Replace('+', '.'); 1495XmlQualifiedName qname = DataContract.GetXmlName(genParam); 1512return DataContract.EncodeLocalName(typeName); 1588[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1589[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1596[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1597[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1601DataContract? dataContract = GetBuiltInDataContract(fullTypeName); 1640localName = DataContract.EncodeLocalName(localName); 1869[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1870[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1877[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1878[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1930[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1931[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1940[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1941[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1944while (type != null && DataContract.IsTypeSerializable(type)) 1962DataContract.ThrowInvalidDataContractException(SR.Format(SR.KnownTypeAttributeOneScheme, DataContract.GetClrTypeFullName(type)), type); 1972DataContract.ThrowInvalidDataContractException(SR.Format(SR.KnownTypeAttributeOneScheme, DataContract.GetClrTypeFullName(type)), type); 1978DataContract.ThrowInvalidDataContractException(SR.Format(SR.KnownTypeAttributeNoData, DataContract.GetClrTypeFullName(type)), type); 1982DataContract.ThrowInvalidDataContractException(SR.Format(SR.KnownTypeAttributeEmptyString, DataContract.GetClrTypeFullName(type)), type); 1986DataContract.ThrowInvalidDataContractException(SR.Format(SR.KnownTypeAttributeUnknownMethod, methodName, DataContract.GetClrTypeFullName(type)), type); 1989DataContract.ThrowInvalidDataContractException(SR.Format(SR.KnownTypeAttributeReturnType, DataContract.GetClrTypeFullName(type), methodName), type); 1994DataContract.ThrowInvalidDataContractException(SR.Format(SR.KnownTypeAttributeMethodNull, DataContract.GetClrTypeFullName(type)), type); 2000DataContract.ThrowInvalidDataContractException(SR.Format(SR.KnownTypeAttributeValidMethodTypes, DataContract.GetClrTypeFullName(type)), type); 2024if (DataContract.GetDataContract(type) is CollectionDataContract collectionDataContract && collectionDataContract.IsDictionary && 2027DataContract itemDataContract = DataContract.GetDataContract(Globals.TypeOfKeyValuePair.MakeGenericType(collectionDataContract.ItemType.GetGenericArguments())); 2046[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 2047[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 2050type = DataContract.UnwrapNullableType(type); 2051DataContract dataContract = DataContract.GetDataContract(type); 2056else if (nameToDataContractTable.TryGetValue(dataContract.XmlName, out DataContract? alreadyExistingContract)) 2077if (other is DataContract dataContract) 2195return (type.Module.Equals(typeof(DataContract).Module) || IsAssemblyFriendOfSerialization(type.Assembly)) && !type.IsNestedPrivate; 2255[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 2256[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 2258[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 2259[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 2264[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 2265[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 2276: this(DataContract.GetClrTypeFullName(type.GetGenericTypeDefinition()), type.GetGenericArguments()) 2286DataContract.GetClrNameAndNamespace(genericTypeName, out string name, out _); 2287_nestedParamCounts = DataContract.GetDataContractNameForGenericName(name, null); 2300[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 2301[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 2307[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 2308[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 2324[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 2325[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 2332parametersFromBuiltInNamespaces = DataContract.IsBuiltInNamespace(GetXmlName(j).Namespace); 2340[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 2341[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 2350_genericParams[i] = qname = DataContract.GetXmlName(paramType); 2352_genericParams[i] = qname = ((DataContract)o).XmlName; 2373[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 2374[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 2379return new XmlQualifiedName(DataContract.EncodeLocalName(DataContract.ExpandGenericParameters(XmlConvert.DecodeName(_xmlName.Name), this)), _xmlName.Namespace); 2420[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 2421[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 2428[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 2429[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 2448[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 2449[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 2460parametersFromBuiltInNamespaces = DataContract.IsBuiltInNamespace(_paramGenericInfos[j].GetXmlNamespace());
System\Runtime\Serialization\DataContractResolver.cs (4)
13[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 14[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 16[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 17[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\DataContractSerializer.cs (67)
12using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, System.Runtime.Serialization.DataContracts.DataContract>; 19private DataContract? _rootContract; // post-surrogate 90Initialize(type, dictionary.Add(rootName), dictionary.Add(DataContract.GetNamespace(rootNamespace)), knownTypes, int.MaxValue, ignoreExtensionDataObject, preserveObjectReferences, null, false); 175[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 176[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 222private DataContract RootContract 224[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 225[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 230_rootContract = DataContract.GetDataContract((_serializationSurrogateProvider == null) ? _rootType : GetSurrogatedType(_serializationSurrogateProvider, _rootType)); 237[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 238[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 244[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 245[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 253[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 254[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 260[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 261[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 267[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 268[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 274[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 275[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 281[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 282[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 288[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 289[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 295[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 296[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 302[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 303[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 309[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 310[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 316[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 317[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 323[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 324[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 330[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 331[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 337[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 338[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 344[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 345[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 351[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 352[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 358[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 359[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 365[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 366[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 372DataContract contract = RootContract; 422[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 423[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 424internal static DataContract GetDataContract(DataContract declaredTypeContract, Type declaredType, Type objectType) 436return DataContract.GetDataContract(objectType); 440[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 441[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 450[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 451[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 457[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 458[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 490DataContract contract = RootContract; 506[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 507[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 524[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 525[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 536[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 537[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 540return DataContractSurrogateCaller.GetDataContractType(serializationSurrogateProvider, DataContract.UnwrapNullableType(type));
System\Runtime\Serialization\DataContractSet.cs (106)
11using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, System.Runtime.Serialization.DataContracts.DataContract>; 18private Dictionary<DataContract, object>? _processedContracts; 34[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 35[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 44foreach (KeyValuePair<XmlQualifiedName, DataContract> pair in dataContractSet.Contracts) 51foreach (KeyValuePair<DataContract, object> pair in dataContractSet._processedContracts) 61public Dictionary<DataContract, object> ProcessedContracts => 62_processedContracts ??= new Dictionary<DataContract, object>(); 78[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 79[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 82DataContract dataContract = GetDataContract(type); 87[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 88[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 89private void Add(DataContract dataContract) 94[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 95[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 96internal void Add(XmlQualifiedName name, DataContract dataContract) 103[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 104[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 105internal void InternalAdd(XmlQualifiedName name, DataContract dataContract) 107if (Contracts.TryGetValue(name, out DataContract? dataContractInSet)) 115bool typeNamesEqual = (DataContract.GetClrTypeFullName(dataContract.UnderlyingType) == DataContract.GetClrTypeFullName(dataContractInSet.UnderlyingType)); 116throw new InvalidOperationException(SR.Format(SR.DupTypeContractInDataContractSet, (typeNamesEqual ? dataContract.UnderlyingType.AssemblyQualifiedName : DataContract.GetClrTypeFullName(dataContract.UnderlyingType)), (typeNamesEqual ? dataContractInSet.UnderlyingType.AssemblyQualifiedName : DataContract.GetClrTypeFullName(dataContractInSet.UnderlyingType)), dataContract.XmlName.Name, dataContract.XmlName.Namespace)); 139[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 140[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 154DataContract memberDataContract = GetMemberTypeDataContract(dataMember); 173[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 174[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 186DataContract itemContract = GetItemTypeDataContract(collectionDataContract); 194[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 195[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 201[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 202[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 207foreach (DataContract knownDataContract in knownDataContracts.Values) 214[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 215[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 221return DataContract.GetXmlName(dcType); 223return DataContract.GetXmlName(clrType); 226[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 227[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 228public DataContract GetDataContract(Type type) 231return DataContract.GetDataContract(type); 233DataContract? dataContract = DataContract.GetBuiltInDataContract(type); 238dataContract = DataContract.GetDataContract(dcType); 249[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 250[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 251public DataContract? GetDataContract(XmlQualifiedName key) 253DataContract? dataContract = DataContract.GetBuiltInDataContract(key.Name, key.Namespace); 261[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 262[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 263internal DataContract GetMemberTypeDataContract(DataMember dataMember) 276DataContract.GetClrTypeFullName(dataMemberType), 277(dataMember.MemberInfo.DeclaringType != null) ? DataContract.GetClrTypeFullName(dataMember.MemberInfo.DeclaringType) : dataMember.MemberInfo.DeclaringType, 281return DataContract.GetGetOnlyCollectionDataContract(DataContract.GetId(dataMemberType.TypeHandle), dataMemberType.TypeHandle, dataMemberType); 291[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 292[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 293internal DataContract GetItemTypeDataContract(CollectionDataContract collectionContract) 300[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 301[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 304if (DataContract.GetBuiltInDataContract(key.Name, key.Namespace) != null) 312[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 313[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 321_referencedTypesDictionary.Add(DataContract.GetXmlName(Globals.TypeOfNullable), Globals.TypeOfNullable); 336[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 337[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 352XmlQualifiedName genericDictionaryName = DataContract.GetXmlName(Globals.TypeOfDictionaryGeneric); 359[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 360[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 406[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 407[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 432[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 433[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 434public Type? GetReferencedType(XmlQualifiedName xmlName, DataContract dataContract, out DataContract? referencedContract, out object[]? genericParameters, bool? supportGenericTypes = null) 461[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 462[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 463private Type? GetReferencedGenericTypeInternal(GenericInfo genInfo, out DataContract? referencedContract, out object[]? genericParameters) 488DataContract[] structureCheckContracts = new DataContract[genInfo.Parameters.Count]; 493DataContract? paramContract = GetDataContract(paramXmlName); 517referencedContract = DataContract.GetDataContract(type).BindGenericParameters(structureCheckContracts); 523[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 524[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 525private Type? GetReferencedTypeInternal(XmlQualifiedName xmlName, DataContract? dataContract) 558[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 559[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 560internal bool TryGetReferencedType(XmlQualifiedName xmlName, DataContract? dataContract, [NotNullWhen(true)] out Type? type) 565[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 566[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 567internal bool TryGetReferencedCollectionType(XmlQualifiedName xmlName, DataContract? dataContract, [NotNullWhen(true)] out Type? type) 572[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 573[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 574private bool TryGetReferencedType(XmlQualifiedName xmlName, DataContract? dataContract, bool useReferencedCollectionTypes, [NotNullWhen(true)] out Type? type) 598DataContract other = GetDataContract(conflictingType); 634internal bool IsContractProcessed(DataContract dataContract) 639internal void SetContractProcessed(DataContract dataContract) 644internal IEnumerator<KeyValuePair<XmlQualifiedName, DataContract>> GetEnumerator() 649[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 650[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 657[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 658[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\DataContractSurrogateCaller.cs (15)
14[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 15[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 18if (DataContract.GetBuiltInDataContract(type) != null) 24[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 25[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 30if (DataContract.GetBuiltInDataContract(objType) != null) 36[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 37[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 42if (DataContract.GetBuiltInDataContract(objType) != null) 52[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 53[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 56if (DataContract.GetBuiltInDataContract(clrType) != null) 66[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 67[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 70if (DataContract.GetBuiltInDataContract(typeName, typeNamespace) != null)
System\Runtime\Serialization\DataMember.cs (30)
20internal DataMember(DataContract memberTypeContract, string name, bool isNullable, bool isRequired, bool emitDefaultValue, long order) 65public DataContract MemberTypeContract 67[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 68[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 74[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 75[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 99private DataContract? _memberTypeContract; 118internal CriticalHelper(DataContract memberTypeContract, string name, bool isNullable, bool isRequired, bool emitDefaultValue, long order) 185internal DataContract MemberTypeContract 187[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 188[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 195_memberTypeContract = DataContract.GetGetOnlyCollectionDataContract(DataContract.GetId(MemberType.TypeHandle), MemberType.TypeHandle, MemberType); 199_memberTypeContract = DataContract.GetDataContract(MemberType); 227[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 228[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 252return DataContract.FieldRequiresMemberAccess(field); 260return DataContract.MethodRequiresMemberAccess(getMethod) || !DataContract.IsTypeVisible(property.PropertyType); 277return DataContract.FieldRequiresMemberAccess(field); 285return DataContract.MethodRequiresMemberAccess(setMethod) || !DataContract.IsTypeVisible(property.PropertyType); 291[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 292[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 293internal DataMember BindGenericParameters(DataContract[] paramContracts, Dictionary<DataContract, DataContract>? boundContracts = null) 295DataContract memberTypeContract = MemberTypeContract.BindGenericParameters(paramContracts, boundContracts); 305[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 306[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\EnumDataContract.cs (30)
23[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 24[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 35public override DataContract BaseContract 37[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 38[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 45[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 46[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 76private sealed class EnumDataContractCriticalHelper : DataContract.DataContractCriticalHelper 81private DataContract _baseContract; 122[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 123[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 128XmlName = DataContract.GetXmlName(type, out _hasDataContract); 131_baseContract = DataContract.GetBuiltInDataContract(baseTypeName.Name, baseTypeName.Namespace)!; 148DataContract.ThrowInvalidDataContractException( 150DataContract.GetClrTypeFullName(type), 158internal DataContract BaseContract => _baseContract; 164[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 165[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 173_baseContract = DataContract.GetBuiltInDataContract(value.Name, value.Namespace)!; 233ThrowInvalidDataContractException(SR.Format(SR.TooManyEnumMembers, DataContract.GetClrTypeFullName(field.DeclaringType!), field.Name)); 240ThrowInvalidDataContractException(SR.Format(SR.InvalidEnumMemberValue, field.Name, DataContract.GetClrTypeFullName(type))); 252ThrowInvalidDataContractException(SR.Format(SR.DataMemberOnEnumField, DataContract.GetClrTypeFullName(field.DeclaringType!), field.Name)); 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))); 386throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.InvalidEnumValueOnRead, value.Substring(index, count), DataContract.GetClrTypeFullName(UnderlyingType))); 444[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 445[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 451[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 452[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\ExtensionDataReader.cs (1)
652throw new XmlException(SR.Format(SR.InvalidDataNode, DataContract.GetClrTypeFullName(type)));
System\Runtime\Serialization\GenericParameterDataContract.cs (12)
14[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 15[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 26private sealed class GenericParameterDataContractCriticalHelper : DataContract.DataContractCriticalHelper 30[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 31[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 37SetDataContractName(DataContract.GetXmlName(type)); 44[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 45[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 46internal override DataContract BindGenericParameters(DataContract[] paramContracts, Dictionary<DataContract, DataContract>? boundContracts = null)
System\Runtime\Serialization\Globals.cs (2)
303[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 304[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\Json\DataContractJsonSerializer.cs (89)
18using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, System.Runtime.Serialization.DataContracts.DataContract>; 33private DataContract? _rootContract; // post-surrogate 39[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 40[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 46[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 47[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 53[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 54[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 60[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 61[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 67[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 68[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 74[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 75[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 81[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 82[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 92[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 93[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 129[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 130[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 183private DataContract RootContract 185[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 186[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 191_rootContract = DataContract.GetDataContract(_rootType); 219[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 220[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 227[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 228[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 235[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 236[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 244[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 245[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 251[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 252[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 258[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 259[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 265[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 266[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 272[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 273[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 280[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 281[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 288[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 289[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 299[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 300[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 306[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 307[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 313[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 314[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 320[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 321[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 327[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 328[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 335[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 336[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 347if (!DataContract.IsValidNCName(jsonName)) 399[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 400[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 401internal static object? ReadJsonValue(DataContract contract, XmlReaderDelegator reader, XmlObjectSerializerReadContextComplexJson? context) 411[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 412[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 428[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 429[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 440[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 441[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 461DataContract contract = RootContract; 471[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 472[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 478[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 479[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 487[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 488[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 496DataContract contract = RootContract; 541[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 542[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 556[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 557[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 574[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 575[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 612[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 613[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 629internal static void CheckIfTypeIsReference(DataContract dataContract) 635DataContract.GetClrTypeFullName(dataContract.UnderlyingType), 640[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 641[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 642internal static DataContract GetDataContract(DataContract declaredTypeContract, Type declaredType, Type objectType) 644DataContract contract = DataContractSerializer.GetDataContract(declaredTypeContract, declaredType, objectType);
System\Runtime\Serialization\Json\JsonByteArrayDataContract.cs (4)
16[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 17[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 23[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 24[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\Json\JsonClassDataContract.cs (13)
18[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 19[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 28[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 29[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 59[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 60[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 94[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 95[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 104[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 105[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 121[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 122[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 164throw new SerializationException(SR.Format(SR.JsonDuplicateMemberNames, DataContract.GetClrTypeFullName(_traditionalClassDataContract.UnderlyingType), _traditionalClassDataContract.MemberNames[i].Value));
System\Runtime\Serialization\Json\JsonCollectionDataContract.cs (15)
18[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 19[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 28[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 29[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 59[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 60[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 72throw new InvalidDataContractException(SR.Format(SR.GetOnlyCollectionMustHaveAddMethod, DataContract.GetClrTypeFullName(this.TraditionalDataContract.UnderlyingType))); 96[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 97[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 127[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 128[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 149[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 150[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 166[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 167[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\Json\JsonDataContract.cs (39)
14using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, System.Runtime.Serialization.DataContracts.DataContract>; 22[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 23[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 24protected JsonDataContract(DataContract traditionalDataContract) 38protected DataContract TraditionalDataContract => _helper.TraditionalDataContract; 42public static JsonReadWriteDelegates? GetGeneratedReadWriteDelegates(DataContract c) 51internal static JsonReadWriteDelegates GetReadWriteDelegatesFromGeneratedAssembly(DataContract c) 64internal static JsonReadWriteDelegates? TryGetReadWriteDelegatesFromGeneratedAssembly(DataContract c) 70[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 71[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 72public static JsonDataContract GetJsonDataContract(DataContract traditionalDataContract) 77[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 78[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 87[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 88[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 94[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 95[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 103[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 104[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 157private readonly DataContract _traditionalDataContract; 160[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 161[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 162internal JsonDataContractCriticalHelper(DataContract traditionalDataContract) 171internal DataContract TraditionalDataContract => _traditionalDataContract; 175[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 176[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 177public static JsonDataContract GetJsonDataContract(DataContract traditionalDataContract) 214[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 215[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 216private static JsonDataContract CreateJsonDataContract(int id, DataContract traditionalDataContract) 279[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 280[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 285foreach (KeyValuePair<XmlQualifiedName, DataContract> knownDataContract in _traditionalDataContract.KnownDataContracts) 290DataContract itemContract = collectionDataContract.ItemContract; 298DataContract itemDataContract = DataContract.GetDataContract(Globals.TypeOfKeyValuePair.MakeGenericType(collectionDataContract.ItemType.GenericTypeArguments)); 317private static readonly Dictionary<DataContract, JsonReadWriteDelegates> s_jsonDelegates = new Dictionary<DataContract, JsonReadWriteDelegates>(); 319public static Dictionary<DataContract, JsonReadWriteDelegates> GetJsonDelegates()
System\Runtime\Serialization\Json\JsonEnumDataContract.cs (8)
13[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 14[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 23[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 24[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 41[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 42[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 59[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 60[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\Json\JsonFormatGeneratorStatics.cs (8)
136[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 149[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 162[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 175[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 188[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 299[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 421[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 446[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (52)
30[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 31[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 37[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 38[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 44[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 45[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 62[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 63[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 70BeginMethod(_ilg, "Read" + DataContract.SanitizeTypeName(classContract.XmlName!.Name) + "FromJson", typeof(JsonFormatClassReaderDelegate), memberAccessFlag); 125[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 126[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 136[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 137[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 145[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 154BeginMethod(_ilg, "Read" + DataContract.SanitizeTypeName(collectionContract.XmlName.Name) + "FromJson" + "IsGetOnly", typeof(JsonFormatGetOnlyCollectionReaderDelegate), memberAccessFlag); 158BeginMethod(_ilg, "Read" + DataContract.SanitizeTypeName(collectionContract.XmlName.Name) + "FromJson", typeof(JsonFormatCollectionReaderDelegate), memberAccessFlag); 177[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 198[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 281[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 282[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 307[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 308[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 356[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 357[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 451[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 456throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.SerializationInfo_ConstructorNotFound, DataContract.GetClrTypeFullName(classContract.UnderlyingType))); 465[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 466[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 483_ilg.Call(_contextArg, XmlFormatGeneratorStatics.ReadIfNullOrRefMethod, _xmlReaderArg, type, DataContract.IsTypeSerializable(type)); 493ThrowSerializationException(SR.Format(SR.ValueTypeCannotBeNull, DataContract.GetClrTypeFullName(type))); 509ThrowSerializationException(SR.Format(SR.ValueTypeCannotHaveId, DataContract.GetClrTypeFullName(type))); 532ThrowSerializationException(SR.Format(SR.ValueTypeCannotHaveRef, DataContract.GetClrTypeFullName(type))); 557[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 563_ilg.Load(DataContract.GetId(declaredType.TypeHandle)); 581[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 582[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 597[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 598[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 724[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 725[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 741DataContract keyDataContract = keyValueDataContract.Members![0].MemberTypeContract; 763DataContract.GetClrTypeFullName(collectionContract.UnderlyingType), 764DataContract.GetClrTypeFullName(keyType))); 818[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 819[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 908[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 909[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 960[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 961[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 984[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 985[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 990ClassDataContract? keyValuePairContract = DataContract.GetDataContract(value.LocalType) as ClassDataContract;
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (29)
28[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 29[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 35[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 36[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 55[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 56[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 63BeginMethod(_ilg, "Write" + DataContract.SanitizeTypeName(classContract.XmlName.Name) + "ToJson", typeof(JsonFormatClassWriterDelegate), memberAccessFlag); 82[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 83[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 90BeginMethod(_ilg, "Write" + DataContract.SanitizeTypeName(collectionContract.XmlName.Name) + "ToJson", typeof(JsonFormatCollectionWriterDelegate), memberAccessFlag); 112[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 125[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 200[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 201[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 230[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 231[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 306[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 307[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 506[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 507[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 554[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 555[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 621[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 622[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 659_ilg.Call(_contextArg, XmlFormatGeneratorStatics.WriteNullMethod, _xmlWriterArg, memberType, DataContract.IsTypeSerializable(memberType)); 685_ilg.Call(_contextArg, XmlFormatGeneratorStatics.WriteNullMethod, _xmlWriterArg, memberType, DataContract.IsTypeSerializable(memberType)); 712_ilg.Load(DataContract.GetId(memberType.TypeHandle)); 717[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 718[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\Json\JsonObjectDataContract.cs (8)
14[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 15[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 16public JsonObjectDataContract(DataContract traditionalDataContract) 21[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 22[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 50return DataContractJsonSerializer.ReadJsonValue(DataContract.GetDataContract(Globals.TypeOfObjectArray), jsonReader, context); 59[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 60[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\Json\JsonQNameDataContract.cs (4)
16[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 17[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 23[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 24[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\Json\JsonStringDataContract.cs (4)
16[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 17[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 23[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 24[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\Json\JsonUriDataContract.cs (4)
11[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 12[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 18[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 19[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\Json\JsonXmlDataContract.cs (8)
11using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, System.Runtime.Serialization.DataContracts.DataContract>; 17[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 18[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 24[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 25[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 48[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 49[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 76foreach (KeyValuePair<XmlQualifiedName, DataContract> pair in entry)
System\Runtime\Serialization\Json\ReflectionJsonFormatReader.cs (18)
30[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 31[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 43[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 44[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 50[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 51[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 60[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 61[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 115[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 116[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 124var itemContract = XmlObjectSerializerWriteContextComplexJson.GetRevisedItemContract(collectionContract.ItemContract); 128[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 129[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 145[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 146[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 161DataContract keyDataContract = keyValueDataContract.Members![0].MemberTypeContract; 182DataContract.GetClrTypeFullName(collectionContract.UnderlyingType), 183DataContract.GetClrTypeFullName(keyType))
System\Runtime\Serialization\Json\ReflectionJsonFormatWriter.cs (9)
22[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 23[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 29[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 30[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 104DataContract? itemContract; 142[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 143[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 200[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 201[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\Json\XmlObjectSerializerReadContextComplexJson.cs (25)
21internal XmlObjectSerializerReadContextComplexJson(DataContractJsonSerializer serializer, DataContract rootTypeDataContract) 32internal static XmlObjectSerializerReadContextComplexJson CreateContext(DataContractJsonSerializer serializer, DataContract rootTypeDataContract) 37[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 38[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 39protected override object? ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader) 44[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 45[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 262[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 263[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 264internal override DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type? type) 266DataContract dataContract = base.GetDataContract(typeHandle, type); 271[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 272[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 273internal override DataContract GetDataContractSkipValidation(int typeId, RuntimeTypeHandle typeHandle, Type? type) 275DataContract dataContract = base.GetDataContractSkipValidation(typeId, typeHandle, type); 280[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 281[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 282internal override DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle) 284DataContract dataContract = base.GetDataContract(id, typeHandle); 316SR.Format(SR.JsonDuplicateMemberInInput, DataContract.GetClrTypeFullName(obj.GetType()), memberNames[memberIndex])); 337SR.JsonOneRequiredMemberNotFound, DataContract.GetClrTypeFullName(obj.GetType()), stringBuilder.ToString())); 342SR.JsonRequiredMembersNotFound, DataContract.GetClrTypeFullName(obj.GetType()), stringBuilder.ToString())); 351[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 352[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 353protected override DataContract? ResolveDataContractFromRootDataContract(XmlQualifiedName typeQName)
System\Runtime\Serialization\Json\XmlObjectSerializerWriteContextComplexJson.cs (57)
22internal static XmlObjectSerializerWriteContextComplexJson CreateContext(DataContractJsonSerializer serializer, DataContract rootTypeDataContract) 27internal XmlObjectSerializerWriteContextComplexJson(DataContractJsonSerializer serializer, DataContract rootTypeDataContract) 96[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 97[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 98protected override bool WriteTypeInfo(XmlWriterDelegator writer, DataContract contract, DataContract declaredContract) 138private static bool RequiresJsonTypeInfo(DataContract contract) 148[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 149[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 150protected override void WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle declaredTypeHandle) 171[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 172[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 175DataContract dataContract; 190DataContract declaredTypeContract = (declaredTypeID >= 0) 204[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 205[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 206private void HandleCollectionAssignedToObject(Type declaredType, ref DataContract dataContract, ref object obj, ref bool verifyKnownType) 240[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 241[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 242internal override void SerializeWithXsiTypeAtTopLevel(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle originalDeclaredTypeHandle, Type graphType) 262[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 263[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 264private void VerifyType(DataContract dataContract, Type declaredType) 275throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.DcTypeNotFoundOnSerialize, DataContract.GetClrTypeFullName(dataContract.UnderlyingType), dataContract.XmlName.Name, dataContract.XmlName.Namespace)); 290[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 291[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 312DataContract dc = GetDataContract(dataNode.Value.GetType()); 320internal static void VerifyObjectCompatibilityWithInterface(DataContract contract, object graph, Type declaredType) 335[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 336[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 342if (DataContract.GetClrTypeFullName(objType) != serInfo.FullTypeName) 344throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.ChangingFullTypeNameNotSupported, serInfo.FullTypeName, DataContract.GetClrTypeFullName(objType))); 354[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 355[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 356internal static DataContract? GetRevisedItemContract(DataContract oldItemContract) 362return DataContract.GetDataContract(oldItemContract.UnderlyingType); 367[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 368[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 369internal override DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type? type) 371DataContract dataContract = base.GetDataContract(typeHandle, type); 376[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 377[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 378internal override DataContract GetDataContractSkipValidation(int typeId, RuntimeTypeHandle typeHandle, Type? type) 380DataContract dataContract = base.GetDataContractSkipValidation(typeId, typeHandle, type); 385[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 386[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 387internal override DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle) 389DataContract dataContract = base.GetDataContract(id, typeHandle); 394[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 395[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 396protected override DataContract? ResolveDataContractFromRootDataContract(XmlQualifiedName typeQName) 401[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 402[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 403internal static DataContract? ResolveJsonDataContractFromRootDataContract(XmlObjectSerializerContext context, XmlQualifiedName typeQName, DataContract rootTypeDataContract) 411DataContract itemContract;
System\Runtime\Serialization\KnownTypeDataContractResolver.cs (6)
21[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 22[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 38DataContract contract = DataContract.GetDataContract(type); 53[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 54[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\PrimitiveDataContract.cs (141)
30[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 31[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 34return DataContract.GetBuiltInDataContract(type) as PrimitiveDataContract; 37[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 38[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 41return DataContract.GetBuiltInDataContract(name, ns) as PrimitiveDataContract; 64[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 80[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 97[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 98[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 135private sealed class PrimitiveDataContractCriticalHelper : DataContract.DataContractCriticalHelper 182[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 183[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 189[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 190[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 197[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 198[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 219[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 220[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 226[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 227[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 234[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 235[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 251[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 252[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 258[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 259[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 266[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 267[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 283[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 284[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 290[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 291[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 298[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 299[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 315[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 316[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 322[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 323[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 330[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 331[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 347[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 348[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 354[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 355[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 362[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 363[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 401[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 402[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 408[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 409[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 415[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 416[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 432[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 433[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 439[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 440[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 447[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 448[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 464[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 465[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 471[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 472[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 479[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 480[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 500[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 501[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 507[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 508[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 515[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 516[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 557[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 558[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 564[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 565[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 572[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 573[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 589[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 590[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 596[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 597[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 604[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 605[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 621[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 622[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 628[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 629[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 636[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 637[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 653[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 654[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 660[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 661[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 668[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 669[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 685[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 686[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 692[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 693[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 700[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 701[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 721[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 722[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 728[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 729[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 742[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 743[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 859[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 860[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 866[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 867[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 880[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 881[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 899[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 900[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 906[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 907[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 952[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 953[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 959[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 960[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 967[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 968[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 993[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 994[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1000[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1001[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1008[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1009[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1030[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1031[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1037[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1038[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1051[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1052[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1070[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1071[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1077[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1078[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1091[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1092[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\ReflectionClassWriter.cs (14)
21[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 22[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 44[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 45[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 83context.WriteNull(xmlWriter, memberType, DataContract.IsTypeSerializable(memberType)); 98context.WriteNull(xmlWriter, memberType, DataContract.IsTypeSerializable(memberType)); 109[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 110[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 118[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 119[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 166[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 167[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 172context.InternalSerialize(xmlWriter, obj, isDeclaredType, writeXsiType, DataContract.GetId(memberType.TypeHandle), memberType.TypeHandle); 176context.InternalSerializeReference(xmlWriter, obj, isDeclaredType, writeXsiType, DataContract.GetId(memberType.TypeHandle), memberType.TypeHandle);
System\Runtime\Serialization\ReflectionReader.cs (46)
33[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 34[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 67[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 68[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 90[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 91[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 97[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 98[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 123[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 124[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 139[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 146[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 147[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 193[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 194[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 197[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 198[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 204[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 205[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 223[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 224[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 247[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 248[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 275[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 276[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 281string objectId = context.ReadIfNullOrRef(xmlReader, type, DataContract.IsTypeSerializable(type)); 291throw new SerializationException(SR.Format(SR.ValueTypeCannotHaveId, DataContract.GetClrTypeFullName(type))); 307throw new SerializationException(SR.Format(SR.ValueTypeCannotHaveRef, DataContract.GetClrTypeFullName(type))); 319throw new SerializationException(SR.Format(SR.ValueTypeCannotBeNull, DataContract.GetClrTypeFullName(type))); 330[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 331[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 343[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 344[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 364[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 381[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 382[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 391[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 392[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 395return context.InternalDeserialize(xmlReader, DataContract.GetId(type.TypeHandle), type.TypeHandle, name, ns); 426[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 476[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 477[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 525[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 608throw new InvalidDataContractException(SR.Format(SR.CollectionMustHaveAddMethod, DataContract.GetClrTypeFullName(collectionContract.UnderlyingType))); 624[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 625[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\ReflectionXmlFormatReader.cs (10)
30[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 31[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 42[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 43[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 49[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 50[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 59[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 60[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 122[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 123[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\ReflectionXmlFormatWriter.cs (8)
19[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 20[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 26[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 27[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 94[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 95[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 135[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 136[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\SchemaExporter.cs (51)
39[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 40[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 47foreach (KeyValuePair<XmlQualifiedName, DataContract> pair in _dataContractSet.Contracts) 49DataContract dataContract = pair.Value; 76[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 77[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 78private void ExportDataContract(DataContract dataContract) 104private XmlSchemaElement ExportTopLevelElement(DataContract dataContract, XmlSchema? schema) 117[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 118[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 136DataContract memberTypeContract = _dataContractSet.GetMemberTypeDataContract(dataMember); 184private static void SetElementType(XmlSchemaElement element, DataContract dataContract, XmlSchema schema) 248[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 249[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 256if (DataContract.GetBuiltInDataContract(clrType) != null 278typeName = DataContract.GetClrTypeFullName(clrType).Substring(nsLen).Replace('+', '.'); 283genericArgumentCounts = DataContract.GetDataContractNameForGenericName(typeName, null); 286XmlQualifiedName dcqname = DataContract.GetXmlName(clrType); 292dcqname = new XmlQualifiedName(collectionName, DataContract.GetCollectionNamespace(dcqname.Namespace)); 336[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 337[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 359[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 360[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 402DataContract itemContract = _dataContractSet.GetItemTypeDataContract(collectionDataContract); 421[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 422[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 462[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 463[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 503[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 504[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 537throw new InvalidDataContractException(SR.Format(SR.MissingSchemaType, typeQName, DataContract.GetClrTypeFullName(clrType))); 591[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 592[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 601throw new InvalidDataContractException(SR.Format(SR.InvalidXmlDataContractName, DataContract.GetClrTypeFullName(type))); 604[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 605[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 613xmlName = DataContract.GetDefaultXmlName(clrType); 627throw new InvalidDataContractException(SR.Format(SR.InvalidGetSchemaMethod, DataContract.GetClrTypeFullName(clrType))); 628xmlName = DataContract.GetDefaultXmlName(clrType); 634throw new InvalidDataContractException(SR.Format(SR.MissingGetSchemaMethod, DataContract.GetClrTypeFullName(clrType), methodName)); 637throw new InvalidDataContractException(SR.Format(SR.InvalidReturnTypeOnGetSchemaMethod, DataContract.GetClrTypeFullName(clrType), methodName, DataContract.GetClrTypeFullName(getMethod.ReturnType), DataContract.GetClrTypeFullName(Globals.TypeOfXmlQualifiedName), typeof(XmlSchemaType))); 644throw new InvalidDataContractException(SR.Format(SR.InvalidNonNullReturnValueByIsAny, DataContract.GetClrTypeFullName(clrType), methodName)); 645xmlName = DataContract.GetDefaultXmlName(clrType); 651xmlName = DataContract.GetDefaultXmlName(clrType); 661DataContract.GetDefaultXmlName(DataContract.GetClrTypeFullName(clrType), out typeName, out typeNs); 682throw new InvalidDataContractException(SR.Format(SR.MissingSchemaType, typeName, DataContract.GetClrTypeFullName(clrType))); 707throw new InvalidDataContractException(SR.Format(SR.InvalidReturnSchemaOnGetSchemaMethod, DataContract.GetClrTypeFullName(clrType))); 766typeName = new XmlQualifiedName(name, DataContract.GetDefaultXmlNamespace(type));
System\Runtime\Serialization\SchemaImporter.cs (81)
16using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, System.Runtime.Serialization.DataContracts.DataContract>; 44[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 45[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 167[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 168[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 183[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 184[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 185internal static bool IsObjectContract(DataContract dataContract) 210[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 211[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 229DataContract dataContract = ImportType(knownType); 348[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 349[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 350private DataContract ImportAnonymousGlobalElement(XmlSchemaElement element, XmlQualifiedName typeQName, string? ns) 352DataContract contract = ImportAnonymousElement(element, typeQName); 361[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 362[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 363private DataContract ImportAnonymousElement(XmlSchemaElement element, XmlQualifiedName typeQName) 382[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 383[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 384private DataContract ImportType(XmlQualifiedName typeName) 386DataContract? dataContract = DataContract.GetBuiltInDataContract(typeName.Name, typeName.Namespace); 399[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 400[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 401private DataContract ImportType(XmlSchemaType type) 407[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 408[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 409private DataContract ImportType(XmlSchemaType type, XmlQualifiedName typeName, bool isAnonymous) 411DataContract? dataContract = _dataContractSet.GetDataContract(typeName); 522[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 523[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 540[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 541[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 557DataContract baseContract = ImportType(restriction.BaseType); 620[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 621[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 622private DataContract? ImportType(XmlQualifiedName typeName, XmlSchemaParticle? rootParticle, XmlSchemaObjectCollection attributes, XmlSchemaAnyAttribute? anyAttribute, XmlQualifiedName? baseTypeName, XmlSchemaAnnotation? annotation) 624DataContract? dataContract = null; 651[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 652[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 694[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 695[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 696private DataContract ImportXmlDataType(XmlQualifiedName typeName, XmlSchemaType xsdType, bool isAnonymous) 698DataContract? dataContract = _dataContractSet.GetDataContract(typeName); 727[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 728[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 748return (XmlDataContract?)DataContract.GetBuiltInDataContract(Globals.TypeOfXmlElement); 751return (XmlDataContract?)DataContract.GetBuiltInDataContract(Globals.TypeOfXmlNodeArray); 821[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 822[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 897[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 898[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 942[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 943[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 953DataContract? memberTypeContract = null; 1047[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1048[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1081DataContract? contract = _dataContractSet.GetDataContract(shortName); 1122GenericInfo genericInfo = new GenericInfo(DataContract.GetXmlName(Globals.TypeOfKeyValue), Globals.TypeOfKeyValue.FullName); 1133[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1134[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1140genericInfo = new GenericInfo(DataContract.GetXmlName(Globals.TypeOfNullable), Globals.TypeOfNullable.FullName); 1168[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1169[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1191[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1192[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1222[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1223[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1224private DataContract ImportSimpleTypeRestriction(XmlQualifiedName typeName, XmlSchemaSimpleTypeRestriction restriction) 1226DataContract dataContract = null!; // Always assigned by one of the ImportType()s, or exception is thrown. 1238[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1239[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1240private void ImportDataContractExtension(XmlSchemaType type, DataContract dataContract) 1262private static void ImportGenericInfo(XmlSchemaType type, DataContract dataContract) 1292name = DataContract.EncodeLocalName(name); 1330[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1331[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1403[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1404[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1405private void AddDataContract(DataContract dataContract)
System\Runtime\Serialization\ScopedKnownTypes.cs (3)
8using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, System.Runtime.Serialization.DataContracts.DataContract>; 35internal DataContract? GetDataContract(XmlQualifiedName qname) 40DataContract? dataContract;
System\Runtime\Serialization\SpecialTypeDataContract.cs (1)
23private sealed class SpecialTypeDataContractCriticalHelper : DataContract.DataContractCriticalHelper
System\Runtime\Serialization\XmlDataContract.cs (27)
16using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, System.Runtime.Serialization.DataContracts.DataContract>; 28[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 29[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 37[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 38[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 92[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 93[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 123private sealed class XmlDataContractCriticalHelper : DataContract.DataContractCriticalHelper 134[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 135[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 141throw new InvalidDataContractException(SR.Format(SR.IXmlSerializableCannotHaveDataContract, DataContract.GetClrTypeFullName(type))); 143throw new InvalidDataContractException(SR.Format(SR.IXmlSerializableCannotHaveCollectionDataContract, DataContract.GetClrTypeFullName(type))); 171_topLevelElementName = string.IsNullOrEmpty(elementName) ? Name : dictionary.Add(DataContract.EncodeLocalName(elementName)); 177throw new InvalidDataContractException(SR.Format(SR.IsAnyCannotHaveXmlRoot, DataContract.GetClrTypeFullName(UnderlyingType!))); 184[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 185[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 194_knownDataContracts = DataContract.ImportKnownTypeAttributes(this.UnderlyingType); 254throw new InvalidDataContractException(SR.Format(SR.IXmlSerializableMustHaveDefaultConstructor, DataContract.GetClrTypeFullName(UnderlyingType))); 269[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 270[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 278ilg.BeginMethod("Create" + DataContract.GetClrTypeFullName(type), typeof(CreateXmlSerializableDelegate), memberAccessFlag); 343throw new SecurityException(SR.Format(SR.PartialTrustIXmlSerializableTypeNotPublic, DataContract.GetClrTypeFullName(UnderlyingType)), 353throw new SecurityException(SR.Format(SR.PartialTrustIXmlSerialzableNoPublicConstructor, DataContract.GetClrTypeFullName(UnderlyingType)), 407[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 408[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 417[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 418[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (24)
122[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 165[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 217[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 218[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 359[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 388[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 403[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 446[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 559[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 644[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 673[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 688[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 703[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 771[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 824[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 839[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 846[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 851s_writeXmlValueMethod = typeof(DataContract).GetMethod("WriteXmlValue", Globals.ScanAllMembers); 861[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 866s_readXmlValueMethod = typeof(DataContract).GetMethod("ReadXmlValue", Globals.ScanAllMembers); 880s_namespaceProperty = typeof(DataContract).GetProperty("Namespace", Globals.ScanAllMembers); 921[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 950[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1053s_throwInvalidDataContractExceptionMethod = typeof(DataContract).GetMethod("ThrowInvalidDataContractException", Globals.ScanAllMembers, new Type[] { typeof(string), typeof(Type) });
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (51)
34[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 35[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 41[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 42[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 48[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 49[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 71[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 72[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 78[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 79[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 163[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 164[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 170[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 171[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 188[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 189[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 195[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 196[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 211[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 253[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 282_ilg.Call(null, XmlFormatGeneratorStatics.GetUninitializedObjectMethod, DataContract.GetIdForInitialization(classContract)); 347[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 348[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 373[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 374[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 413[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 414[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 487[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 502[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 503[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 520_ilg.Call(_contextArg, XmlFormatGeneratorStatics.ReadIfNullOrRefMethod, _xmlReaderArg, type, DataContract.IsTypeSerializable(type)); 530ThrowValidationException(SR.Format(SR.ValueTypeCannotBeNull, DataContract.GetClrTypeFullName(type))); 546ThrowValidationException(SR.Format(SR.ValueTypeCannotHaveId, DataContract.GetClrTypeFullName(type))); 569ThrowValidationException(SR.Format(SR.ValueTypeCannotHaveRef, DataContract.GetClrTypeFullName(type))); 594[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 600_ilg.Load(DataContract.GetId(declaredType.TypeHandle)); 614[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 615[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 631[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 632[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 773[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 774[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 837[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 838[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 888[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 889[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 911[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 912[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 919ClassDataContract? keyValuePairContract = DataContract.GetDataContract(value.LocalType) as ClassDataContract; 1007[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1010var type = DataContract.GetDataContractForInitialization(id).TypeForInitialization;
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (30)
31[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 32[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 38[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 39[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 65[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 66[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 72[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 73[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 109[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 110[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 116[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 117[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 153[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 233[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 234[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 287[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 288[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 372[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 373[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 539[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 540[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 587[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 588[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 634[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 635[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 672_ilg.Call(_contextArg, XmlFormatGeneratorStatics.WriteNullMethod, _xmlWriterArg, memberType, DataContract.IsTypeSerializable(memberType)); 698_ilg.Call(_contextArg, XmlFormatGeneratorStatics.WriteNullMethod, _xmlWriterArg, memberType, DataContract.IsTypeSerializable(memberType)); 724_ilg.Load(DataContract.GetId(memberType.TypeHandle)); 730[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 731[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\XmlObjectSerializer.cs (77)
15using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, System.Runtime.Serialization.DataContracts.DataContract>; 21[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 22[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 24[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 25[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 27[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 28[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 31[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 32[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 42[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 43[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 51[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 52[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 60[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 61[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 69[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 70[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 78[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 79[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 85[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 86[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 92[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 93[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 114[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 115[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 122[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 123[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 131[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 132[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 138[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 139[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 145[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 146[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 152[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 153[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 160[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 161[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 180[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 181[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 202[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 203[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 222internal static void WriteRootElement(XmlWriterDelegator writer, DataContract contract, XmlDictionaryString? name, XmlDictionaryString? ns, bool needsContractNsAtRoot) 240internal static bool CheckIfNeedsContractNsAtRoot(XmlDictionaryString? name, XmlDictionaryString? ns, DataContract contract) 262internal static bool IsContractDeclared(DataContract contract, DataContract declaredContract) 268[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 269[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 277[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 278[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 286[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 287[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 293[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 294[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 302[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 303[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 306[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 307[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 315[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 316[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 319[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 320[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 326[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 327[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 333[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 334[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 341[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 342[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 348[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 349[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 368[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 369[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 388internal static bool IsRootXmlAny(XmlDictionaryString? rootName, DataContract contract) 398[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 399[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 400internal static bool IsRootElement(XmlReaderDelegator reader, DataContract contract, XmlDictionaryString? name, XmlDictionaryString? ns) 426DataContract objectContract = PrimitiveDataContract.GetPrimitiveDataContract(Globals.TypeOfObject)!; 458string typeInfo = (type == null) ? string.Empty : SR.Format(SR.ErrorTypeInfo, DataContract.GetClrTypeFullName(type));
System\Runtime\Serialization\XmlObjectSerializerContext.cs (57)
13using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, System.Runtime.Serialization.DataContracts.DataContract>; 20protected DataContract? rootTypeDataContract; 48internal XmlObjectSerializerContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver? dataContractResolver) 98[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 99[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 100internal DataContract GetDataContract(Type type) 105[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 106[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 107internal virtual DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type? type) 111return DataContract.GetGetOnlyCollectionDataContract(DataContract.GetId(typeHandle), typeHandle, type); 115return DataContract.GetDataContract(typeHandle); 119[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 120[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 121internal virtual DataContract GetDataContractSkipValidation(int typeId, RuntimeTypeHandle typeHandle, Type? type) 125return DataContract.GetGetOnlyCollectionDataContractSkipValidation(typeId, typeHandle, type); 129return DataContract.GetDataContractSkipValidation(typeId, typeHandle, type); 133[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 134[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 135internal virtual DataContract GetDataContract(int id, RuntimeTypeHandle typeHandle) 139return DataContract.GetGetOnlyCollectionDataContract(id, typeHandle, null /*type*/); 143return DataContract.GetDataContract(id, typeHandle); 147[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 148[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 155[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 156[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 163[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 164[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 177[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 178[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 179private DataContract? GetDataContractFromSerializerKnownTypes(XmlQualifiedName qname) 184DataContract? outDataContract; 188[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 189[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 201DataContract.CheckAndAdd(knownType, typesChecked, ref dataContracts); 206[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 207[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 208internal bool IsKnownType(DataContract dataContract, DataContractDictionary? knownDataContracts, Type? declaredType) 226[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 227[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 228internal bool IsKnownType(DataContract dataContract, Type? declaredType) 230DataContract? knownContract = ResolveDataContractFromKnownTypes(dataContract.XmlName.Name, dataContract.XmlName.Namespace, null /*memberTypeContract*/, declaredType); 234[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 235[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 238DataContract? dataContract = ResolveDataContractFromKnownTypes(typeName); 242[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 243[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 244private DataContract? ResolveDataContractFromKnownTypes(XmlQualifiedName typeName) => 249[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 250[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 251protected DataContract? ResolveDataContractFromKnownTypes(string typeName, string? typeNs, DataContract? memberTypeContract, Type? declaredType) 254DataContract? dataContract; 283[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 284[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 285protected virtual DataContract? ResolveDataContractFromRootDataContract(XmlQualifiedName typeQName) 290DataContract itemContract = GetDataContract(GetSurrogatedType(collectionContract.ItemType));
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (70)
15using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, System.Runtime.Serialization.DataContracts.DataContract>; 60throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.NullValueReturnedForGetOnlyCollection, DataContract.GetClrTypeFullName(type))); 66throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.ArrayExceededSize, arraySize, DataContract.GetClrTypeFullName(type))); 69internal static XmlObjectSerializerReadContext CreateContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver? dataContractResolver) 81internal XmlObjectSerializerReadContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver? dataContractResolver) 87[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 88[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 91DataContract dataContract = GetDataContract(id, declaredTypeHandle); 95[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 96[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 99DataContract dataContract = GetDataContract(declaredType); 103[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 104[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 105internal virtual object? InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract? dataContract, string? name, string? ns) 111[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 112[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 121throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.ErrorDeserializing, SR.Format(SR.ErrorTypeInfo, DataContract.GetClrTypeFullName(declaredType)), SR.Format(SR.XmlStartElementExpected, Globals.RefLocalName))); 138[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 139[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 140protected object? InternalDeserialize(XmlReaderDelegator reader, string? name, string? ns, Type declaredType, ref DataContract dataContract) 157DataContract? tempDataContract = ResolveDataContractFromKnownTypes(attributes.XsiTypeName, attributes.XsiTypeNamespace, dataContract, declaredType); 172DataContract? factoryDataContract = ResolveDataContractFromKnownTypes(attributes.FactoryTypeName, attributes.FactoryTypeNamespace, dataContract, declaredType); 182throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.FactoryTypeNotISerializable, DataContract.GetClrTypeFullName(factoryDataContract.UnderlyingType), DataContract.GetClrTypeFullName(dataContract.UnderlyingType))); 219[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 220[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 232[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 233[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 264[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 265[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 278[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 279[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 292[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 293[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 367string oldType = (oldObj != null) ? DataContract.GetClrTypeFullName(oldObj.GetType()) : SR.UnknownNullType; 368string newType = (newObj != null) ? DataContract.GetClrTypeFullName(newObj.GetType()) : SR.UnknownNullType; 378[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 379[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 422[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 423[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 459DataContract.GetClrTypeFullName(typeof(T)))); 494[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 495[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 502[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 503[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 509[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 510[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 541[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 542[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 588[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 589[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 590protected virtual DataContract? ResolveDataContractFromTypeName() 597[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 598[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 610[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 611[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 656DataContract? dataContract = ResolveDataContractFromTypeName(); 709[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 710[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 784[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 785[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 805[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 806[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 862[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 863[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 943[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 944[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1085[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 1086[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 1087protected virtual object? ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)
System\Runtime\Serialization\XmlObjectSerializerReadContextComplex.cs (20)
17internal XmlObjectSerializerReadContextComplex(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver? dataContractResolver) 29[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 30[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 39[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 40[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 49[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 50[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 51internal override object? InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract? dataContract, string? name, string? ns) 59[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 60[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 61private object? InternalDeserializeWithSurrogate(XmlReaderDelegator xmlReader, Type declaredType, DataContract? surrogateDataContract, string? name, string? ns) 65DataContract dataContract = surrogateDataContract ?? 69throw new InvalidDataContractException(SR.Format(SR.SurrogatesWithGetOnlyCollectionsNotSupportedSerDeser, DataContract.GetClrTypeFullName(declaredType))); 80[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 81[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 89if (!DataContract.IsTypeSerializable(memberType)) 97[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 98[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 107type = DataContract.UnwrapNullableType(type); 112DataContract.GetClrTypeFullName(type)));
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (86)
34internal static XmlObjectSerializerWriteContext CreateContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver? dataContractResolver) 41protected XmlObjectSerializerWriteContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver? resolver) 84[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 85[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 93[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 94[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 104DataContract contract = GetDataContract(declaredTypeID, declaredTypeHandle); 112DataContract dataContract = (declaredTypeID >= 0) 124[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 125[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 126internal void SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle declaredTypeHandle) 142[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 143[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 144internal virtual void SerializeWithXsiTypeAtTopLevel(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle originalDeclaredTypeHandle, Type graphType) 165[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 166[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 170DataContract dataContract; 173dataContract = GetDataContractSkipValidation(DataContract.GetId(objectTypeHandle), objectTypeHandle, objectType); 197DataContract declaredTypeContract = (declaredTypeID >= 0) 207internal bool OnHandleIsReference(XmlWriterDelegator xmlWriter, DataContract contract, object obj) 230[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 231[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 232protected void SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, bool verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType) 245DataContract? knownContract = ResolveDataContractFromKnownTypes(dataContract.XmlName.Name, dataContract.XmlName.Namespace, null /*memberTypeContract*/, declaredType); 248throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.DcTypeNotFoundOnSerialize, DataContract.GetClrTypeFullName(dataContract.UnderlyingType), dataContract.XmlName.Name, dataContract.XmlName.Namespace)); 261internal virtual bool WriteClrTypeInfo(XmlWriterDelegator xmlWriter, DataContract dataContract) 291[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 292[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 310[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 311[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 329[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 330[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 348[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 349[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 365internal void HandleGraphAtTopLevel(XmlWriterDelegator writer, object obj, DataContract contract) 383throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.CannotSerializeObjectWithCycles, DataContract.GetClrTypeFullName(obj.GetType()))); 399[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 400[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 407[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 408[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 499throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.UnknownXmlType, DataContract.GetClrTypeFullName(obj.GetType()))); 513[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 514[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 533[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 534[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 537if (DataContract.GetClrTypeFullName(objType) != serInfo.FullTypeName) 550DataContract.GetDefaultXmlName(serInfo.FullTypeName, out typeName, out typeNs); 551xmlWriter.WriteAttributeQualifiedName(Globals.SerPrefix, DictionaryGlobals.ISerializableFactoryTypeLocalName, DictionaryGlobals.SerializationNamespace, DataContract.GetClrTypeString(typeName), DataContract.GetClrTypeString(typeNs)); 559XmlDictionaryString name = DataContract.GetClrTypeString(DataContract.EncodeLocalName(serEntry.Name)); 575[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 576[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 577protected virtual void WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle declaredTypeHandle) 587[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 588[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 598[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 599[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 606throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.ResolveTypeReturnedFalse, DataContract.GetClrTypeFullName(DataContractResolver.GetType()), DataContract.GetClrTypeFullName(objectType))); 616throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.ResolveTypeReturnedNull, DataContract.GetClrTypeFullName(DataContractResolver.GetType()), DataContract.GetClrTypeFullName(objectType))); 621throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.ResolveTypeReturnedNull, DataContract.GetClrTypeFullName(DataContractResolver.GetType()), DataContract.GetClrTypeFullName(objectType))); 626[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 627[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 628protected virtual bool WriteTypeInfo(XmlWriterDelegator writer, DataContract contract, DataContract declaredContract) 656[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 657[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 677[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 678[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 687[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 688[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 697[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 698[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 740[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 741[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 753[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 754[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 772[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 773[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 795[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 796[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 820[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 821[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System\Runtime\Serialization\XmlObjectSerializerWriteContextComplex.cs (22)
24internal XmlObjectSerializerWriteContextComplex(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver? dataContractResolver) 36internal override bool WriteClrTypeInfo(XmlWriterDelegator xmlWriter, DataContract dataContract) 58[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 59[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 79[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 80[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 100[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 101[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 121[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 122[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 139[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 140[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 178[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 179[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 187if (!DataContract.IsTypeSerializable(memberType)) 195[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 196[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 205type = DataContract.UnwrapNullableType(type); 210DataContract.GetClrTypeFullName(type))); 219[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 220[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 243DataContract contract = GetDataContract(objTypeHandle, objType);
System\Runtime\Serialization\XmlReaderDelegator.cs (1)
213DataContract.GetClrTypeFullName(type)));
System\Runtime\Serialization\XmlSerializableWriter.cs (3)
27throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.IXmlSerializableMissingEndElements, (_obj == null ? string.Empty : DataContract.GetClrTypeFullName(_obj.GetType())))); 56throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.IXmlSerializableWritePastSubTree, (_obj == null ? string.Empty : DataContract.GetClrTypeFullName(_obj.GetType())))); 64throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.IXmlSerializableWritePastSubTree, (_obj == null ? string.Empty : DataContract.GetClrTypeFullName(_obj.GetType()))));
System\Runtime\Serialization\XmlWriterDelegator.cs (1)
274return new InvalidDataContractException(SR.Format(SR.InvalidPrimitiveType_Serialization, DataContract.GetClrTypeFullName(type)));
System\Runtime\Serialization\XPathQueryGenerator.cs (14)
22[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 23[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 30[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 31[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 37DataContract currentContract = DataContract.GetDataContract(type); 59[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 60[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 61private static DataContract ProcessDataContract(DataContract contract, ExportContext context, MemberInfo memberNode) 70[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 71[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 72private static DataContract ProcessClassDataContract(ClassDataContract contract, ExportContext context, MemberInfo memberNode) 110public ExportContext(DataContract rootContract)
System\Runtime\Serialization\XsdDataContractExporter.cs (35)
102[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 103[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 134[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 135[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 163[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 164[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 187[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 188[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 194DataContract dataContract = DataContract.GetDataContract(type); 206[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 207[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 213DataContract dataContract = DataContract.GetDataContract(type); 225[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 226[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 232DataContract dataContract = DataContract.GetDataContract(type); 244[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 245[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 254[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 255[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 259if (!type.ContainsGenericParameters && DataContract.IsTypeSerializable(type)) 263[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 264[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 270[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 271[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 279[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 280[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 305[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 306[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 343[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 344[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)] 378[RequiresDynamicCode(DataContract.SerializerAOTWarning)] 379[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
System.Runtime.Serialization.Schema (67)
System\Runtime\Serialization\Schema\CodeExporter.cs (55)
21using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, System.Runtime.Serialization.DataContracts.DataContract>; 51foreach (KeyValuePair<XmlQualifiedName, DataContract> pair in dataContractSet.Contracts) 53DataContract dataContract = pair.Value; 211foreach (KeyValuePair<XmlQualifiedName, DataContract> pair in _dataContractSet.Contracts) 213DataContract dataContract = pair.Value; 260private void ExportClassDataContractHierarchy(XmlQualifiedName typeName, DataContract classContract, ContractCodeDomInfo contractCodeDomInfo, Dictionary<XmlQualifiedName, object?> contractNamesInHierarchy) 268DataContract? baseContract = classContract.BaseContract; 305internal CodeTypeReference GetCodeTypeReference(DataContract dataContract) 336if (param is DataContract paramContract) 360internal CodeTypeReference GetElementTypeReference(DataContract dataContract, bool isElementTypeNullable) 372get { return DataContract.GetXmlName(typeof(List<>)); } 375private DataContract GenericListContract 385get { return DataContract.GetXmlName(typeof(Dictionary<,>)); } 388private DataContract GenericDictionaryContract 394private ContractCodeDomInfo GetContractCodeDomInfo(DataContract dataContract) 408private void GenerateType(DataContract dataContract, ContractCodeDomInfo contractCodeDomInfo) 469private CodeTypeDeclaration? GetNestedType(DataContract dataContract, ContractCodeDomInfo contractCodeDomInfo) 478DataContract? containingDataContract = _dataContractSet.GetDataContract(new XmlQualifiedName(containingTypeName, dataContract.XmlName.Namespace)); 514private static CodeTypeDeclaration CreateTypeDeclaration(string typeName, DataContract dataContract) 535private CodeTypeReference? GetReferencedType(DataContract dataContract) 541Type? type = _dataContractSet.GetReferencedType(dataContract.XmlName, dataContract, out DataContract? referencedContract, out object[]? parameters, SupportsGenericTypeReference); 597private CodeTypeReference? GetReferencedCollectionType(DataContract? collectionContract) 610DataContract itemContract = collectionContract.BaseContract!; 629private static bool HasDefaultCollectionNames(DataContract collectionContract) 634DataContract itemContract = collectionContract.BaseContract!; 647private bool TryGetReferencedDictionaryType(DataContract collectionContract, [NotNullWhen(true)] out CodeTypeReference? typeReference) 655Type? type = _dataContractSet.GetReferencedType(GenericDictionaryName, GenericDictionaryContract, out DataContract? _, out object[]? _) ?? typeof(Dictionary<,>); 658DataContract? itemContract = collectionContract.BaseContract!.As(DataContractType.ClassDataContract); 681private bool TryGetReferencedListType(DataContract itemContract, bool isItemTypeNullable, out CodeTypeReference? typeReference) 685Type? type = _dataContractSet.GetReferencedType(GenericListName, GenericListContract, out DataContract? _, out object[]? _); 698private CodeTypeReference? GetSurrogatedTypeReference(DataContract dataContract) 711private Type? GetReferencedTypeOnImport(DataContract dataContract) 716if (DataContract.GetBuiltInDataContract(dataContract.XmlName.Name, dataContract.XmlName.Namespace) == null) 778private void ExportClassDataContract(DataContract classDataContract, ContractCodeDomInfo contractCodeDomInfo) 896internal ICollection<CodeTypeReference>? GetKnownTypeReferences(DataContract dataContract) 907foreach (DataContract knownTypeContract in knownTypeContracts) 915private DataContractDictionary? GetKnownTypeContracts(DataContract dataContract) 927return GetKnownTypeContracts(dataContract, new Dictionary<DataContract, object?>()); 933private DataContractDictionary? GetKnownTypeContracts(DataContract classDataContract, Dictionary<DataContract, object?> handledContracts) 944DataContract memberContract = dataMember.MemberTypeContract; 966private static void AddKnownTypeContracts(DataContract classDataContract, DataContractDictionary? knownContracts) 975foreach (KeyValuePair<XmlQualifiedName, DataContract> pair in knownContracts) 983private void AddKnownTypes(DataContract classDataContract, ContractCodeDomInfo contractCodeDomInfo) 987DataContractDictionary? knownContractDictionary = GetKnownTypeContracts(classDataContract, new Dictionary<DataContract, object?>()); 991ICollection<DataContract> knownTypeContracts = knownContractDictionary.Values; 992foreach (DataContract knownTypeContract in knownTypeContracts) 1051private static void ThrowIfReferencedBaseTypeSealed(Type baseType, DataContract dataContract) 1058private void ExportEnumDataContract(DataContract enumDataContract, ContractCodeDomInfo contractCodeDomInfo) 1107private void ExportISerializableDataContract(DataContract classDataContract, ContractCodeDomInfo contractCodeDomInfo) 1167private void GenerateKeyValueType(DataContract? keyValueContract) 1189private void ExportCollectionDataContract(DataContract collectionContract, ContractCodeDomInfo contractCodeDomInfo) 1206DataContract itemContract = collectionContract.BaseContract!; 1449private string GetClrNamespace(DataContract dataContract, ContractCodeDomInfo contractCodeDomInfo) 1610internal static bool IsObjectContract(DataContract? dataContract)
System\Runtime\Serialization\Schema\SchemaImportHelper.cs (5)
22internal static DataContractType GetContractType(this DataContract dataContract) => dataContract.ContractType switch 32internal static bool Is(this DataContract dataContract, DataContractType dcType) 37internal static DataContract? As(this DataContract dataContract, DataContractType dcType) 45internal static bool IsItemTypeNullable(this DataContract collectionDataContract)
System\Runtime\Serialization\Schema\XsdDataContractImporter.cs (7)
221DataContract dataContract = FindDataContract(typeName); 239DataContract dataContract = FindDataContract(typeName); 245internal DataContract FindDataContract(XmlQualifiedName typeName) 250DataContract? dataContract = DataContract.GetBuiltInDataContract(typeName.Name, typeName.Namespace); 271DataContract? dataContract = DataContract.GetBuiltInDataContract(typeName.Name, typeName.Namespace);
System.Runtime.Serialization.Xml (1)
artifacts\obj\System.Runtime.Serialization.Xml\Debug\net10.0\System.Runtime.Serialization.Xml.Forwards.cs (1)
4[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.DataContracts.DataContract))]