ExtensionMethods
Contains extension methods for IEdmModel interfaces.
public static void AddAlternateKeyAnnotation(this EdmModel model, IEdmEntityType type, IDictionary<string, IEdmProperty> alternateKey)
Adds the alternate keys to this entity type.
Creates and adds a complex type to the model.
public static EdmComplexType AddComplexType(this EdmModel model, string namespaceName, string name, IEdmComplexType baseType)
Creates and adds a complex type to the model.
public static EdmComplexType AddComplexType(this EdmModel model, string namespaceName, string name, IEdmComplexType baseType, bool isAbstract)
Creates and adds a complex type to the model.
public static EdmComplexType AddComplexType(this EdmModel model, string namespaceName, string name, IEdmComplexType baseType, bool isAbstract, bool isOpen)
Creates and adds a complex type to the model.
public static EdmEntityContainer AddEntityContainer(this EdmModel model, string namespaceName, string name)
Creates and adds an entity container to the model.
Creates and adds an entity type to the model.
public static EdmEntityType AddEntityType(this EdmModel model, string namespaceName, string name, IEdmEntityType baseType)
Creates and adds an entity type to the model.
public static EdmEntityType AddEntityType(this EdmModel model, string namespaceName, string name, IEdmEntityType baseType, bool isAbstract, bool isOpen)
Creates and adds an entity type to the model.
public static EdmEntityType AddEntityType(this EdmModel model, string namespaceName, string name, IEdmEntityType baseType, bool isAbstract, bool isOpen, bool hasStream)
Creates and adds an entity type to the model.
public static EdmTerm AddTerm(this EdmModel model, string namespaceName, string name, EdmPrimitiveTypeKind kind)
Creates and adds a new instance of the EdmTerm class from a primitive type kind.
public static EdmTerm AddTerm(this EdmModel model, string namespaceName, string name, IEdmTypeReference type)
Creates and adds a new instance of the EdmTerm class from a type reference.
public static EdmTerm AddTerm(this EdmModel model, string namespaceName, string name, IEdmTypeReference type, string appliesTo, string defaultValue)
Creates and adds a new instance of the EdmTerm class from a type reference.
Gets the element type of a collection definition or itself of a non-collection definition referred to by the type reference.
Gets the base type of this references definition.
Gets the base type of this reference.
Gets the base type of this entity type definition.
Gets the base type of the definition of this reference.
Returns the base type of the definition of this reference.
Gets the base type of this structured type definition.
Gets the definition of this collection reference.
Gets the definition of this reference typed as an IEdmComplexTypeDefinition.
public static IEnumerable<IEdmNavigationProperty> DeclaredNavigationProperties(this IEdmStructuredTypeReference type)
Gets the navigation properties declared in the definition of this reference.
public static IEnumerable<IEdmNavigationProperty> DeclaredNavigationProperties(this IEdmStructuredType type)
Gets the navigation properties declared in this structured type definition.
public static IEnumerable<IEdmStructuralProperty> DeclaredStructuralProperties(this IEdmStructuredType type)
Gets all structural properties declared in the IEdmStructuredTypeDefinition.
public static IEnumerable<IEdmStructuralProperty> DeclaredStructuralProperties(this IEdmStructuredTypeReference type)
Gets all structural properties declared in the definition of this reference.
Gets the entity type declaring this navigation property.
public static IEnumerable<IEdmStructuralProperty> DependentProperties(this IEdmNavigationProperty navigationProperty)
Gets the dependent properties of this navigation property, returning null if this is the principal entity or if there is no referential constraint.
public static IEnumerable<IEdmDirectValueAnnotation> DirectValueAnnotations(this IEdmModel model, IEdmElement element)
Gets the direct annotations for an element.
Gets the element type of the definition of this collection reference.
Gets the definition of this entity reference.
public static IEdmEntityReferenceType EntityReferenceDefinition(this IEdmEntityReferenceTypeReference type)
Gets the definition of this entity reference type reference.
Returns entity sets belonging to an IEdmEntityContainer.
Gets the entity type referred to by the definition of this entity reference type reference.
Return the entity type of the navigation source.
Gets the definition of this enumeration reference.
If the container name in the model is the same as the input name. The input name maybe full qualified name.
public static IEnumerable<IEdmOperation> FilterByName(this IEnumerable<IEdmOperation> operations, bool forceFullyQualifiedNameFilter, string operationName)
Checks whether all operations have the same return type
public static IEnumerable<IEdmStructuredType> FindAllDerivedTypes(this IEdmModel model, IEdmStructuredType baseType)
Finds a list of types that derive from the supplied type directly or indirectly, and across models.
public static IEnumerable<IEdmOperation> FindBoundOperations(this IEdmModel model, IEdmType bindingType)
Searches for bound operations based on the binding type, returns an empty enumerable if no operation exists.
public static IEnumerable<IEdmOperation> FindBoundOperations(this IEdmModel model, string qualifiedName, IEdmType bindingType)
Searches for bound operations based on the qualified name and binding type, returns an empty enumerable if no operation exists.
Searches for entity set by the given name that may be container qualified in default container and .Extends containers.
public static IEdmNavigationSource FindDeclaredNavigationSource(this IEdmModel model, string qualifiedName)
Searches for entity set or singleton by the given name that may be container qualified in default container and .Extends containers. If no container name is provided, then default container will be searched.
public static IEnumerable<IEdmOperationImport> FindDeclaredOperationImports(this IEdmModel model, string qualifiedName)
Searches for the operation imports by the specified name in default container and .Extends containers, returns an empty enumerable if no operation import exists.
Searches for singleton by the given name that may be container qualified in default container and .Extends containers. If no container name is provided, then default container will be searched.
Searches for an entity container with the given name in this model and all referenced models and returns null if no such entity container exists.
public static IEdmNavigationProperty FindNavigationProperty(this IEdmStructuredTypeReference type, string name)
Finds a navigation property declared in the definition of this reference by name.
Searches for operations with the given name in this model and all referenced models and returns an empty enumerable if no such operations exist.
Finds a property from the definition of this reference.
public static IEdmPropertyConstructor FindProperty(this IEdmRecordExpression expression, string name)
Finds a property of a record expression.
Searches for a term with the given name in this model and all referenced models and returns null if no such term exists.
Searches for a type with the given name in this model and all referenced models and returns null if no such type exists.
public static IEnumerable<IEdmVocabularyAnnotation> FindVocabularyAnnotations(this IEdmModel model, IEdmVocabularyAnnotatable element)
Gets an annotatable element's vocabulary annotations defined in a specific model and models referenced by that model.
public static IEnumerable<T> FindVocabularyAnnotations<T>(this IEdmModel model, IEdmVocabularyAnnotatable element, IEdmTerm term) where T : IEdmVocabularyAnnotation
Gets an annotatable element's vocabulary annotations that bind a particular term.
public static IEnumerable<T> FindVocabularyAnnotations<T>(this IEdmModel model, IEdmVocabularyAnnotatable element, IEdmTerm term, string qualifier) where T : IEdmVocabularyAnnotation
Gets an annotatable element's vocabulary annotations that bind a particular term.
public static IEnumerable<T> FindVocabularyAnnotations<T>(this IEdmModel model, IEdmVocabularyAnnotatable element, string termName) where T : IEdmVocabularyAnnotation
Gets an annotatable element's vocabulary annotations that bind a particular term.
public static IEnumerable<T> FindVocabularyAnnotations<T>(this IEdmModel model, IEdmVocabularyAnnotatable element, string termName, string qualifier) where T : IEdmVocabularyAnnotation
Gets an annotatable element's vocabulary annotations that bind a particular term.
public static IEnumerable<IEdmVocabularyAnnotation> FindVocabularyAnnotationsIncludingInheritedAnnotations(this IEdmModel model, IEdmVocabularyAnnotatable element)
Gets an annotatable element's vocabulary annotations defined in a specific model and models referenced by that model.
Gets the full name of the element.
Gets the full name of the definition referred to by the type reference.
Returns the fully qualified name of a navigation source.
Gets the full name of the definition referred to by the type reference.
public static IEnumerable<IDictionary<string, IEdmProperty>> GetAlternateKeysAnnotation(this IEdmModel model, IEdmEntityType type)
Gets the declared alternate keys of the most defined entity with a declared key present.
public static object GetAnnotationValue(this IEdmModel model, IEdmElement element, string namespaceName, string localName)
Gets an annotation value corresponding to the given namespace and name provided.
public static T GetAnnotationValue<T>(this IEdmModel model, IEdmElement element, string namespaceName, string localName)
Gets an annotation value corresponding to the given namespace and name provided.
Gets an annotation value from an annotatable element.
public static object[] GetAnnotationValues(this IEdmModel model, IEnumerable<IEdmDirectValueAnnotationBinding> annotations)
Retrieves a set of annotation values. For each requested value, returns null if no annotation with the given name exists for the given element.
public static IEnumerable<string> GetDerivedTypeConstraints(this IEdmModel model, IEdmNavigationSource navigationSource)
Gets the collection of qualified type name for term Org.OData.Validation.V1.DerivedTypeConstraint from a navigation source.
public static IEnumerable<string> GetDerivedTypeConstraints(this IEdmModel model, IEdmVocabularyAnnotatable target)
Gets the collection of qualified type name for term Org.OData.Validation.V1.DerivedTypeConstraint from a target annotatable.
public static string GetDescriptionAnnotation(this IEdmModel model, IEdmVocabularyAnnotatable target)
Gets description for term Org.OData.Core.V1.Description from a target annotatable
Gets edmx:Reference information (IEdmReference) from the model.
Gets the value for the EDM version of the model.
public static string GetLongDescriptionAnnotation(this IEdmModel model, IEdmVocabularyAnnotatable target)
Gets description for term Org.OData.Core.V1.LongDescription from a target annotatable
Gets the partner path of a navigation property.
public static IPrimitiveValueConverter GetPrimitiveValueConverter(this IEdmModel model, IEdmTypeReference type)
Get the primitive value converter for the given type definition in the model.
Gets the IEdmOperationReturn from the specified operation.
public static IEdmValue GetTermValue(this IEdmModel model, IEdmStructuredValue context, string termName, EdmExpressionEvaluator expressionEvaluator)
Gets the IEdmValue of a vocabulary term that has been applied to the type of a value.
public static IEdmValue GetTermValue(this IEdmModel model, IEdmStructuredValue context, string termName, string qualifier, EdmExpressionEvaluator expressionEvaluator)
Gets the IEdmValue of a vocabulary term that has been applied to the type of a value.
public static IEdmValue GetTermValue(this IEdmModel model, IEdmStructuredValue context, IEdmTerm term, EdmExpressionEvaluator expressionEvaluator)
Gets the IEdmValue of a vocabulary term that has been applied to the type of a value.
public static IEdmValue GetTermValue(this IEdmModel model, IEdmStructuredValue context, IEdmTerm term, string qualifier, EdmExpressionEvaluator expressionEvaluator)
Gets the IEdmValue of a vocabulary term that has been applied to the type of a value.
public static T GetTermValue<T>(this IEdmModel model, IEdmStructuredValue context, string termName, EdmToClrEvaluator evaluator)
Gets the CLR value of a vocabulary term that has been applied to the type of a value.
public static T GetTermValue<T>(this IEdmModel model, IEdmStructuredValue context, string termName, string qualifier, EdmToClrEvaluator evaluator)
Gets the CLR value of a vocabulary term that has been applied to the type of a value.
public static T GetTermValue<T>(this IEdmModel model, IEdmStructuredValue context, IEdmTerm term, EdmToClrEvaluator evaluator)
Gets the CLR value of a vocabulary term that has been applied to the type of a value.
public static T GetTermValue<T>(this IEdmModel model, IEdmStructuredValue context, IEdmTerm term, string qualifier, EdmToClrEvaluator evaluator)
Gets the CLR value of a vocabulary term that has been applied to the type of a value.
public static IEdmValue GetTermValue(this IEdmModel model, IEdmVocabularyAnnotatable element, string termName, EdmExpressionEvaluator expressionEvaluator)
Gets the IEdmValue of a vocabulary term that has been applied to an element.
public static IEdmValue GetTermValue(this IEdmModel model, IEdmVocabularyAnnotatable element, string termName, string qualifier, EdmExpressionEvaluator expressionEvaluator)
Gets the IEdmValue of a vocabulary term that has been applied to an element.
public static IEdmValue GetTermValue(this IEdmModel model, IEdmVocabularyAnnotatable element, IEdmTerm term, EdmExpressionEvaluator expressionEvaluator)
Gets the IEdmValue of a vocabulary term that has been applied to an element.
public static IEdmValue GetTermValue(this IEdmModel model, IEdmVocabularyAnnotatable element, IEdmTerm term, string qualifier, EdmExpressionEvaluator expressionEvaluator)
Gets the IEdmValue of a vocabulary term that has been applied to an element.
public static T GetTermValue<T>(this IEdmModel model, IEdmVocabularyAnnotatable element, string termName, EdmToClrEvaluator evaluator)
Gets the CLR value of a vocabulary term that has been applied to an element.
public static T GetTermValue<T>(this IEdmModel model, IEdmVocabularyAnnotatable element, string termName, string qualifier, EdmToClrEvaluator evaluator)
Gets the CLR value of a vocabulary term that has been applied to an element.
public static T GetTermValue<T>(this IEdmModel model, IEdmVocabularyAnnotatable element, IEdmTerm term, EdmToClrEvaluator evaluator)
Gets the CLR value of a vocabulary term that has been applied to an element.
public static T GetTermValue<T>(this IEdmModel model, IEdmVocabularyAnnotatable element, IEdmTerm term, string qualifier, EdmToClrEvaluator evaluator)
Gets the CLR value of a vocabulary term that has been applied to an element.
public static IEdmTypeDefinitionReference GetUInt16(this EdmModel model, string namespaceName, bool isNullable)
Get type reference to the default UInt16 type definition.
The default underlying type is DefaultUInt16UnderlyingType.
If the user has already defined his own UInt16, this method will not define anything and simply returns the type reference.
public static IEdmTypeDefinitionReference GetUInt32(this EdmModel model, string namespaceName, bool isNullable)
Get type reference to the default UInt32 type definition.
The default underlying type is DefaultUInt32UnderlyingType.
If the user has already defined his own UInt32, this method will not define anything and simply returns the type reference.
public static IEdmTypeDefinitionReference GetUInt64(this EdmModel model, string namespaceName, bool isNullable)
Get type reference to the default UInt64 type definition.
The default underlying type is DefaultUInt64UnderlyingType.
If the user has already defined his own UInt64, this method will not define anything and simply returns the type reference.
Checks whether the given entity type has the property as one of the key properties.
Determines whether the bound operation's binding type is equivalent to the specified binding type.
Returns true if the definition of this reference is abstract.
Determines whether the specified operation is action.
Determines whether [is action import] [the specified operation import].
Determines whether the specified operation is function.
Determines whether [is function import] [the specified operation import].
Determines whether the specified property is a key for its contained type.
Returns true if the definition of this reference is open.
Returns true if the definition of this reference is open.
Gets whether this navigation property originates at the principal end of an association.
Gets the declared key of the most defined entity with a declared key present.
Gets the entity key of the definition of this reference.
Gets the location of this element.
public static IEnumerable<IEdmNavigationProperty> NavigationProperties(this IEdmStructuredTypeReference type)
Gets the navigation properties declared in the definition of this reference and its base types.
public static IEnumerable<IEdmNavigationProperty> NavigationProperties(this IEdmStructuredType type)
Get the navigation properties declared in this structured type and all base types.
public static EdmNavigationSourceKind NavigationSourceKind(this IEdmNavigationSource navigationSource)
Return the navigation kind of the navigation source.
Returns operation imports belonging to an IEdmEntityContainer.
Gets the definition of this primitive type reference.
Gets the primitive kind of the definition referred to by this type reference.
public static IEnumerable<IEdmStructuralProperty> PrincipalProperties(this IEdmNavigationProperty navigationProperty)
Gets the principal properties of this navigation property, returning null if this is the principal entity or if there is no referential constraint.
Gets all properties of the structured type definition and its base types.
Gets all schema elements from the model, and models referenced by it.
public static void SetAnnotationValue(this IEdmModel model, IEdmElement element, string namespaceName, string localName, object value)
Sets an annotation value for an EDM element. If the value is null, no annotation is added and an existing annotation with the same name is removed.
Sets an annotation value on an annotatable element.
public static void SetAnnotationValues(this IEdmModel model, IEnumerable<IEdmDirectValueAnnotationBinding> annotations)
Sets a set of annotation values. If a supplied value is null, no annotation is added and an existing annotation with the same name is removed.
public static void SetChangeTrackingAnnotation(this EdmModel model, IEdmEntityContainer target, bool isSupported)
Set Org.OData.Capabilities.V1.ChangeTracking to target.
public static void SetChangeTrackingAnnotation(this EdmModel model, IEdmEntitySet target, bool isSupported, IEnumerable<IEdmStructuralProperty> filterableProperties, IEnumerable<IEdmNavigationProperty> expandableProperties)
Set Org.OData.Capabilities.V1.ChangeTracking to target.
public static void SetDescriptionAnnotation(this EdmModel model, IEdmVocabularyAnnotatable target, string description)
Set Org.OData.Core.V1.Description to target.
Sets edmx:Reference information (IEdmReference) to the model.
Sets a value of EDM version attribute of the model.
public static void SetLongDescriptionAnnotation(this EdmModel model, IEdmVocabularyAnnotatable target, string description)
Set Org.OData.Core.V1.LongDescription to target.
public static void SetOptimisticConcurrencyAnnotation(this EdmModel model, IEdmEntitySet target, IEnumerable<IEdmStructuralProperty> properties)
Set annotation Org.OData.Core.V1.OptimisticConcurrency to EntitySet
public static void SetPrimitiveValueConverter(this IEdmModel model, IEdmTypeDefinitionReference typeDefinition, IPrimitiveValueConverter converter)
Set the primitive value converter for the given type definition in the model.
Gets the Short Qualified name of the element.
Gets the short qualified name of the definition referred to by the type reference.
Returns singletons belonging to an IEdmEntityContainer.
public static IEnumerable<IEdmStructuralProperty> StructuralProperties(this IEdmStructuredType type)
Gets the structural properties declared in this type definition and all base types.
public static IEnumerable<IEdmStructuralProperty> StructuralProperties(this IEdmStructuredTypeReference type)
Gets all structural properties declared in the definition of this reference and all its base types.
Gets the definition of this structured type reference.
Gets the multiplicity of the target of this navigation.
Gets the term of this annotation.
Gets the entity type targeted by this navigation property.
Gets the structured type targeted by this structural property type reference.
public static bool TryFindContainerQualifiedEntitySet(this IEdmModel model, string containerQualifiedEntitySetName, out IEdmEntitySet entitySet)
Finds the entity set with qualified entity set name (not simple entity set name).
public static bool TryFindContainerQualifiedOperationImports(this IEdmModel model, string containerQualifiedOperationImportName, out IEnumerable operationImports)
Tries the find container qualified operation imports.
public static bool TryFindContainerQualifiedSingleton(this IEdmModel model, string containerQualifiedSingletonName, out IEdmSingleton singleton)
Finds the singleton.
public static bool TryGetRelativeEntitySetPath(this IEdmOperation operation, IEdmModel model, out IEdmOperationParameter parameter, out Dictionary relativeNavigations, out IEdmEntityType lastEntityType, out IEnumerable errors)
Tries to get the relative entity set path.
public static bool TryGetRelativeEntitySetPath(this IEdmOperationImport operationImport, IEdmModel model, out IEdmOperationParameter parameter, out Dictionary relativeNavigations, out IEnumerable edmErrors)
Analyzes IEdmOperationImport.EntitySet expression and returns a relative path to an IEdmEntitySet if available.
The path starts with the parameter and may have optional sequence of IEdmNavigationProperty and type casts segments.
public static bool TryGetStaticEntitySet(this IEdmOperationImport operationImport, IEdmModel model, out IEdmEntitySetBase entitySet)
Analyzes IEdmOperationImport.EntitySet expression and returns a static IEdmEntitySet reference if available.
Gets the definition of this type definition reference.
Gets the type kind of the type references definition.
public static IEnumerable<IEdmVocabularyAnnotation> VocabularyAnnotations(this IEdmVocabularyAnnotatable element, IEdmModel model)
Gets an annotatable element's vocabulary annotations as seen from a particular model.