Exemple #1
0
 internal void MakeMetadataReadonly()
 {
     if (this.metadataRequiresInitialization)
     {
         foreach (ResourceSet set in this.ResourceSets)
         {
             set.SetReadOnly();
         }
         foreach (ResourceType type in this.Types)
         {
             type.SetReadOnly();
             type.PropertiesDeclaredOnThisType.Count<ResourceProperty>();
         }
         foreach (ServiceOperation operation in this.ServiceOperations)
         {
             operation.SetReadOnly();
         }
         this.metadata = MetadataCache<ProviderMetadataCacheItem>.AddCacheItem(this.dataServiceInstance.GetType(), this.dataSourceInstance, this.metadata);
     }
 }
Exemple #2
0
 internal void LoadMetadata()
 {
     System.Type serviceType = this.dataServiceInstance.GetType();
     System.Type type = this.dataSourceInstance.GetType();
     this.metadata = MetadataCache<ProviderMetadataCacheItem>.TryLookup(serviceType, this.dataSourceInstance);
     if (this.metadata == null)
     {
         this.metadata = new ProviderMetadataCacheItem(type);
         this.PopulateMetadata();
         this.AddOperationsFromType(serviceType);
         this.metadataRequiresInitialization = true;
     }
 }