src/Shared/EntityFramework/Core/Objects/DataClasses/EntityCollection.cs
// This method is required to maintain compatibility with the v1 binary serialization format. 
// In particular, it takes the _relatedEntities HashSet and recreates the dictionary of wrapped
// entities from it.  This is because the dictionary is not serialized.
// Note that this is only expected to work for non-POCO entities, since serialization of POCO
// entities will not result in serialization of the RelationshipManager or its related objects.
/// <summary>Used internally to deserialize entity objects.</summary>
/// <param name="context">The streaming context.</param>
Used internally to deserialize entity objects.
Used internally to deserialize entity objects .
[OnDeserialized]
        [Browsable(false)]
        [EditorBrowsable(EditorBrowsableState.Never)]
        [SuppressMessage("Microsoft.Usage", "CA2238:ImplementSerializationMethodsCorrectly")]
        public void OnCollectionDeserialized(StreamingContext context)
        {
            if (_relatedEntities != null)
            {
                _relatedEntities.OnDeserialization(null);
                _wrappedRelatedEntities = new Dictionary<TEntity, IEntityWrapper>(ObjectReferenceEqualityComparer.Default);
                foreach (var entity in _relatedEntities)
                {
                    _wrappedRelatedEntities.Add(entity, EntityWrapperFactory.WrapEntityUsingContext(entity, ObjectContext));
                }
            }
        }
[ OnDeserialized ] [ Browsable ( false ) ] [ EditorBrowsable ( EditorBrowsableState . Never ) ] [ SuppressMessage ( " " , " " ) ] public void OnCollectionDeserialized ( StreamingContext context ) { if ( _relatedEntities != null ) { _relatedEntities . OnDeserialization ( null ) ; _wrappedRelatedEntities = new Dictionary < TEntity , IEntityWrapper > ( ObjectReferenceEqualityComparer . Default ) ; foreach ( var entity in _relatedEntities ) { _wrappedRelatedEntities . Add ( entity , EntityWrapperFactory . WrapEntityUsingContext ( entity , ObjectContext ) ) ; } } }
Used internally to deserialize entity objects.
Used internally to deserialize entity objects .
// We need to call this here so that the hash set will be fully constructed // ready for access.  Normally, this would happen later in the process.
context
StreamingContext
The streaming context.
The streaming context .