private IEdmVocabularyAnnotation WrapVocabularyAnnotation(CsdlAnnotation annotation, CsdlSemanticsSchema schema, IEdmVocabularyAnnotatable targetContext, CsdlSemanticsAnnotations annotationsContext, string qualifier) { return(EdmUtil.DictionaryGetOrUpdate( this.wrappedAnnotations, annotation, ann => new CsdlSemanticsVocabularyAnnotation(this, schema, targetContext, annotationsContext, ann, qualifier))); }
public IEdmNavigationSource FindNavigationTarget(IEdmNavigationProperty property, IEdmPathExpression bindingPath) { EdmUtil.CheckArgumentNull(property, "property"); if (!property.ContainsTarget && bindingPath != null) { foreach (IEdmNavigationPropertyBinding targetMapping in this.NavigationPropertyBindings) { if (targetMapping.NavigationProperty == property && targetMapping.Path.Path == bindingPath.Path) { return(targetMapping.Target); } } } else if (property.ContainsTarget) { return(EdmUtil.DictionaryGetOrUpdate( this.containedNavigationPropertyCache, property, navProperty => new EdmContainedEntitySet(this, navProperty))); } return(EdmUtil.DictionaryGetOrUpdate( this.unknownNavigationPropertyCache, property, navProperty => new EdmUnknownEntitySet(this, navProperty))); }
/// <summary> /// Finds the navigation source that a navigation property targets. /// </summary> /// <param name="property">The navigation property.</param> /// <returns>The navigation source that the navigation propertion targets, or null if no such navigation source exists.</returns> public virtual IEdmNavigationSource FindNavigationTarget(IEdmNavigationProperty property) { EdmUtil.CheckArgumentNull(property, "property"); if (!property.ContainsTarget) { IEdmNavigationSource result; if (this.navigationPropertyMappings.TryGetValue(property, out result)) { return(result); } } else { return(EdmUtil.DictionaryGetOrUpdate( this.containedNavigationPropertyCache, property, navProperty => new EdmContainedEntitySet(this, navProperty))); } return(EdmUtil.DictionaryGetOrUpdate( this.unknownNavigationPropertyCache, property, navProperty => new EdmUnknownEntitySet(this, navProperty))); }
public IEnumerable <IEdmNavigationPropertyBinding> FindNavigationPropertyBindings(IEdmNavigationProperty navigationProperty) { if (!navigationProperty.ContainsTarget) { return(EdmUtil.DictionaryGetOrUpdate( this.navigationPropertyBindingCache, navigationProperty, property => this.NavigationPropertyBindings.Where(targetMapping => targetMapping.NavigationProperty == property).ToList())); } return(null); }
private IEdmVocabularyAnnotation WrapVocabularyAnnotation(CsdlVocabularyAnnotationBase annotation, CsdlSemanticsSchema schema, IEdmVocabularyAnnotatable targetContext, CsdlSemanticsAnnotations annotationsContext, string qualifier) { return(EdmUtil.DictionaryGetOrUpdate( this.wrappedAnnotations, annotation, ann => { CsdlValueAnnotation valueAnnotation = ann as CsdlValueAnnotation; return valueAnnotation != null ? (CsdlSemanticsVocabularyAnnotation) new CsdlSemanticsValueAnnotation(schema, targetContext, annotationsContext, valueAnnotation, qualifier) : (CsdlSemanticsVocabularyAnnotation) new CsdlSemanticsTypeAnnotation(schema, targetContext, annotationsContext, (CsdlTypeAnnotation)annotation, qualifier); })); }