Exemplo n.º 1
0
		public void AddSchema(CsdlSchema schema)
		{
			this.schemata.Add(schema);
		}
Exemplo n.º 2
0
 public void AddSchema(CsdlSchema schema)
 {
     this.schemata.Add(schema);
 }
Exemplo n.º 3
0
		private void AddSchema(CsdlSchema schema)
		{
			CsdlSemanticsSchema item = new CsdlSemanticsSchema(this, schema);
			this.schemata.Add(item);
			foreach (IEdmSchemaType type in item.Types)
			{
				CsdlSemanticsStructuredTypeDefinition definition = type as CsdlSemanticsStructuredTypeDefinition;
				if (definition != null)
				{
					string baseTypeName = ((CsdlNamedStructuredType) definition.Element).BaseTypeName;
					if (baseTypeName != null)
					{
						string str;
						string str2;
						EdmUtil.TryGetNamespaceNameFromQualifiedName(baseTypeName, out str, out str2);
						if (str2 != null)
						{
							List<IEdmStructuredType> list;
							if (!this.derivedTypeMappings.TryGetValue(str2, out list))
							{
								list = new List<IEdmStructuredType>();
								this.derivedTypeMappings[str2] = list;
							}
							list.Add(definition);
						}
					}
				}
				base.RegisterElement(type);
			}
			foreach (CsdlSemanticsAssociation association in item.Associations)
			{
				RegistrationHelper.AddElement<IEdmAssociation>(association, association.Namespace + "." + association.Name, this.associationDictionary, new Func<IEdmAssociation, IEdmAssociation, IEdmAssociation>(CsdlSemanticsModel.CreateAmbiguousAssociationBinding));
			}
			foreach (IEdmFunction function in item.Functions)
			{
				base.RegisterElement(function);
			}
			foreach (IEdmValueTerm term in item.ValueTerms)
			{
				base.RegisterElement(term);
			}
			foreach (IEdmEntityContainer container in item.EntityContainers)
			{
				base.RegisterElement(container);
			}
			foreach (CsdlAnnotations annotations in schema.OutOfLineAnnotations)
			{
				List<CsdlSemanticsAnnotations> list2;
				string target = annotations.Target;
				string str5 = item.ReplaceAlias(target);
				if (str5 != null)
				{
					target = str5;
				}
				if (!this.outOfLineAnnotations.TryGetValue(target, out list2))
				{
					list2 = new List<CsdlSemanticsAnnotations>();
					this.outOfLineAnnotations[target] = list2;
				}
				list2.Add(new CsdlSemanticsAnnotations(item, annotations));
			}
			foreach (CsdlUsing @using in schema.Usings)
			{
				this.SetNamespaceAlias(@using.Namespace, @using.Alias);
			}
			Version edmVersion = this.GetEdmVersion();
			if ((edmVersion == null) || (edmVersion < schema.Version))
			{
				this.SetEdmVersion(schema.Version);
			}
		}