private static void AddCapabilitiesVocabularyAnnotations(this EdmModel model, NavigationSourceAndAnnotations[] entitySets, EdmTypeMap edmTypeMap)
        {
            Contract.Assert(model != null);
            Contract.Assert(edmTypeMap != null);

            if (entitySets == null)
            {
                return;
            }

            foreach (NavigationSourceAndAnnotations source in entitySets)
            {
                IEdmEntitySet entitySet = source.NavigationSource as IEdmEntitySet;
                if (entitySet == null)
                {
                    continue;
                }

                EntitySetConfiguration entitySetConfig = source.Configuration as EntitySetConfiguration;
                if (entitySetConfig == null)
                {
                    continue;
                }

                model.AddCountRestrictionsAnnotation(entitySet, entitySetConfig, edmTypeMap);
                model.AddNavigationRestrictionsAnnotation(entitySet, entitySetConfig, edmTypeMap);
                model.AddFilterRestrictionsAnnotation(entitySet, entitySetConfig, edmTypeMap);
                model.AddSortRestrictionsAnnotation(entitySet, entitySetConfig, edmTypeMap);
                model.AddExpandRestrictionsAnnotation(entitySet, entitySetConfig, edmTypeMap);
            }
        }
        private static void AddCoreVocabularyAnnotations(this EdmModel model, NavigationSourceAndAnnotations[] entitySets, EdmTypeMap edmTypeMap)
        {
            Contract.Assert(model != null);
            Contract.Assert(edmTypeMap != null);

            if (entitySets == null)
            {
                return;
            }

            foreach (NavigationSourceAndAnnotations source in entitySets)
            {
                IEdmEntitySet entitySet = source.NavigationSource as IEdmEntitySet;
                if (entitySet == null)
                {
                    continue;
                }

                EntitySetConfiguration entitySetConfig = source.Configuration as EntitySetConfiguration;
                if (entitySetConfig == null)
                {
                    continue;
                }

                model.AddOptimisticConcurrencyAnnotation(entitySet, entitySetConfig, edmTypeMap);
            }
        }