internal override bool ResolveNameAndSetTypeUsage(Converter.ConversionCache convertedItemCache, Dictionary<Som.SchemaElement, GlobalItem> newGlobalItems) { if (_typeUsage == null) { Debug.Assert(!(_type is ScalarType)); EdmType edmType = (EdmType)Converter.LoadSchemaElement(_type, _type.Schema.ProviderManifest, convertedItemCache, newGlobalItems); EntityType entityType = edmType as EntityType; Debug.Assert(entityType != null); RefType refType = new RefType(entityType); refType.AddMetadataProperties(this.OtherContent); _typeUsage = TypeUsage.Create(refType); } return true; }
internal override bool ResolveNameAndSetTypeUsage(Converter.ConversionCache convertedItemCache, Dictionary<Som.SchemaElement, GlobalItem> newGlobalItems) { if (_type is ScalarType) //Create and store type usage for scalar type { _typeUsageBuilder.ValidateAndSetTypeUsage(_type as ScalarType, false); _typeUsage = _typeUsageBuilder.TypeUsage; return true; } else //Try to resolve edm type. If not now, it will resolve in the second pass { EdmType edmType = (EdmType)Converter.LoadSchemaElement(_type, _type.Schema.ProviderManifest, convertedItemCache, newGlobalItems); if (edmType != null) { _typeUsageBuilder.ValidateAndSetTypeUsage(edmType, false); //use typeusagebuilder so dont lose facet information _typeUsage = _typeUsageBuilder.TypeUsage; } return _typeUsage != null; } }
internal bool ResolveNestedTypeNames(Converter.ConversionCache convertedItemCache, Dictionary<Som.SchemaElement, GlobalItem> newGlobalItems) { if (_typeSubElement == null) { return false; } return _typeSubElement.ResolveNameAndSetTypeUsage(convertedItemCache, newGlobalItems); }
// internal void EnsureEnumTypeFacets(Converter.ConversionCache convertedItemCache, Dictionary<SchemaElement, GlobalItem> newGlobalItems) { Debug.Assert(Type is SchemaEnumType); EdmType propertyType = (EdmType)Converter.LoadSchemaElement(Type, Type.Schema.ProviderManifest, convertedItemCache, newGlobalItems); _typeUsageBuilder.ValidateAndSetTypeUsage(propertyType, false);//use typeusagebuilder so dont lose facet information }
internal override bool ResolveNameAndSetTypeUsage(Converter.ConversionCache convertedItemCache, Dictionary<Som.SchemaElement, GlobalItem> newGlobalItems) { bool result = true; if (_typeUsage == null) { foreach (var property in _properties) { if (!property.ResolveNameAndSetTypeUsage(convertedItemCache, newGlobalItems)) { result = false; } } } return result; }
internal abstract bool ResolveNameAndSetTypeUsage(Converter.ConversionCache convertedItemCache, Dictionary<Som.SchemaElement, GlobalItem> newGlobalItems);
internal override bool ResolveNameAndSetTypeUsage(Converter.ConversionCache convertedItemCache, Dictionary<Som.SchemaElement, GlobalItem> newGlobalItems) { Debug.Fail("This method was not called from anywhere in the code before. If you got here you need to update this method and possibly ResolveNestedTypeNames()"); return false; }
internal bool ResolveNestedTypeNames(Converter.ConversionCache convertedItemCache, Dictionary<Som.SchemaElement, GlobalItem> newGlobalItems) { Debug.Assert(_typeSubElement != null, "Nested type expected."); return _typeSubElement.ResolveNameAndSetTypeUsage(convertedItemCache, newGlobalItems); }
internal override bool ResolveNameAndSetTypeUsage( Converter.ConversionCache convertedItemCache, Dictionary<SchemaElement, GlobalItem> newGlobalItems) { if (_typeUsage == null) { if (_typeSubElement != null) //Has sub-elements { return _typeSubElement.ResolveNameAndSetTypeUsage(convertedItemCache, newGlobalItems); } else //Does not have sub-elements; try to resolve { if (_type is ScalarType) //Create and store type usage for scalar type { _typeUsageBuilder.ValidateAndSetTypeUsage(_type as ScalarType, false); _typeUsage = TypeUsage.Create(new CollectionType(_typeUsageBuilder.TypeUsage)); return true; } else //Try to resolve edm type. If not now, it will resolve in the second pass { var edmType = (EdmType)Converter.LoadSchemaElement(_type, _type.Schema.ProviderManifest, convertedItemCache, newGlobalItems); if (edmType != null) { _typeUsageBuilder.ValidateAndSetTypeUsage(edmType, false); //use typeusagebuilder so dont lose facet information _typeUsage = TypeUsage.Create(new CollectionType(_typeUsageBuilder.TypeUsage)); } return _typeUsage != null; } } } return true; }