private Dictionary <EntitySetBase, GeneratedView> SerializedGetGeneratedViews(EntityContainer container)
            {
                Debug.Assert(container != null);

                // Note that extentMappingViews will contain both query and update views.
                Dictionary <EntitySetBase, GeneratedView> extentMappingViews;

                // Get the mapping that has the entity container mapped.
                StorageEntityContainerMapping entityContainerMap = MappingMetadataHelper.GetEntityContainerMap(m_storageMappingItemCollection, container);

                // We get here because memoizer didn't find an entry for the container.
                // It might happen that the entry with generated views already exists for the counterpart container, so check it first.
                EntityContainer counterpartContainer = container.DataSpace == DataSpace.CSpace ?
                                                       entityContainerMap.StorageEntityContainer : entityContainerMap.EdmEntityContainer;

                if (m_generatedViewsMemoizer.TryGetValue(counterpartContainer, out extentMappingViews))
                {
                    return(extentMappingViews);
                }

                extentMappingViews = new Dictionary <EntitySetBase, GeneratedView>();

                if (!entityContainerMap.HasViews)
                {
                    return(extentMappingViews);
                }

                // If we are in generated views mode.
                if (m_generatedViewsMode)
                {
                    if (ObjectItemCollection.ViewGenerationAssemblies != null && ObjectItemCollection.ViewGenerationAssemblies.Count > 0)
                    {
                        SerializedCollectViewsFromObjectCollection(this.m_storageMappingItemCollection.Workspace, extentMappingViews);
                    }
                    else
                    {
                        SerializedCollectViewsFromReferencedAssemblies(this.m_storageMappingItemCollection.Workspace, extentMappingViews);
                    }
                }

                if (extentMappingViews.Count == 0)
                {
                    // We should change the mode to runtime generation of views.
                    this.m_generatedViewsMode = false;
                    this.SerializedGenerateViews(entityContainerMap, extentMappingViews);
                }

                Debug.Assert(extentMappingViews.Count > 0, "view should be generated at this point");

                return(extentMappingViews);
            }