Microsoft.OData.Edm by Microsoft

<PackageReference Include="Microsoft.OData.Edm" Version="7.7.0-beta" />

.NET API 949,512 bytes

 ExtensionMethods

public static class 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.

public static EdmComplexType AddComplexType(this EdmModel model, string namespaceName, string name)

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.

public static EdmEntityType AddEntityType(this EdmModel model, string namespaceName, string name)

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.

public static IEdmType AsElementType(this IEdmType type)

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.

public static IEdmEntityType BaseEntityType(this IEdmEntityType type)

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.

Gets the navigation properties declared in the definition of this reference.

Gets the navigation properties declared in this structured type definition.

Gets all structural properties declared in the IEdmStructuredTypeDefinition.

Gets all structural properties declared in the definition of this reference.

Gets the entity type declaring this navigation property.

Gets the dependent properties of this navigation property, returning null if this is the principal entity or if there is no referential constraint.

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.

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.

public static IEdmEntityType EntityType(this IEdmNavigationSource navigationSource)

Return the entity type of the navigation source.

Gets the definition of this enumeration reference.

public static bool ExistsContainer(this IEdmModel model, string containerName)

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

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.

public static IEdmEntitySet FindDeclaredEntitySet(this IEdmModel model, string qualifiedName)

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.

public static IEdmSingleton FindDeclaredSingleton(this IEdmModel model, string qualifiedName)

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.

public static IEdmEntityContainer FindEntityContainer(this IEdmModel model, string qualifiedName)

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.

Finds a navigation property declared in the definition of this reference by name.

public static IEnumerable<IEdmOperation> FindOperations(this IEdmModel model, string qualifiedName)

Searches for operations with the given name in this model and all referenced models and returns an empty enumerable if no such operations exist.

public static IEdmProperty FindProperty(this IEdmStructuredTypeReference type, string name)

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.

public static IEdmTerm FindTerm(this IEdmModel model, string qualifiedName)

Searches for a term with the given name in this model and all referenced models and returns null if no such term exists.

public static IEdmSchemaType FindType(this IEdmModel model, string qualifiedName)

Searches for a type with the given name in this model and all referenced models and returns null if no such type exists.

Gets an annotatable element's vocabulary annotations defined in a specific model and models referenced by that model.

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.

Gets an annotatable element's vocabulary annotations defined in a specific model and models referenced by that model.

public static string FullName(this IEdmSchemaElement element)

Gets the full name of the element.

public static string FullName(this IEdmTypeReference type)

Gets the full name of the definition referred to by the type reference.

public static string FullNavigationSourceName(this IEdmNavigationSource navigationSource)

Returns the fully qualified name of a navigation source.

public static string FullTypeName(this IEdmType type)

Gets the full name of the definition referred to by the type reference.

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.

public static T GetAnnotationValue<T>(this IEdmModel model, IEdmElement element)

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.

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.

public static Version GetEdmVersion(this IEdmModel 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

public static IEdmPathExpression GetPartnerPath(this IEdmNavigationProperty navigationProperty)

Gets the partner path of a navigation property.

Get the primitive value converter for the given type definition in the model.

public static IEdmOperationReturn GetReturn(this IEdmOperation operation)

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.

public static bool HasDeclaredKeyProperty(this IEdmEntityType entityType, IEdmProperty property)

Checks whether the given entity type has the property as one of the key properties.

public static bool HasEquivalentBindingType(this IEdmOperation operation, IEdmType bindingType)

Determines whether the bound operation's binding type is equivalent to the specified binding type.

public static bool IsAbstract(this IEdmStructuredTypeReference type)

Returns true if the definition of this reference is abstract.

public static bool IsAction(this IEdmOperation operation)

Determines whether the specified operation is action.

public static bool IsActionImport(this IEdmOperationImport operationImport)

Determines whether [is action import] [the specified operation import].

public static bool IsFunction(this IEdmOperation operation)

Determines whether the specified operation is function.

public static bool IsFunctionImport(this IEdmOperationImport operationImport)

Determines whether [is function import] [the specified operation import].

public static bool IsKey(this IEdmProperty property)

Determines whether the specified property is a key for its contained type.

public static bool IsOpen(this IEdmStructuredTypeReference type)

Returns true if the definition of this reference is open.

public static bool IsOpen(this IEdmType type)

Returns true if the definition of this reference is open.

public static bool IsPrincipal(this IEdmNavigationProperty navigationProperty)

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.

public static EdmLocation Location(this IEdmElement item)

Gets the location of this element.

Gets the navigation properties declared in the definition of this reference and its base types.

Get the navigation properties declared in this structured type and all base types.

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.

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.

public static void SetAnnotationValue<T>(this IEdmModel model, IEdmElement element, T value)

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.

public static void SetEdmReferences(this IEdmModel model, IEnumerable<IEdmReference> edmReferences)

Sets edmx:Reference information (IEdmReference) to the model.

public static void SetEdmVersion(this IEdmModel model, Version version)

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.

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.

public static string ShortQualifiedName(this IEdmSchemaElement element)

Gets the Short Qualified name of the element.

public static string ShortQualifiedName(this IEdmTypeReference type)

Gets the short qualified name of the definition referred to by the type reference.

Returns singletons belonging to an IEdmEntityContainer.

Gets the structural properties declared in this type definition and all base types.

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.

public static IEdmTerm Term(this IEdmVocabularyAnnotation annotation)

Gets the term of this annotation.

public static IEdmEntityType ToEntityType(this IEdmNavigationProperty property)

Gets the entity type targeted by this navigation property.

public static IEdmStructuredType ToStructuredType(this IEdmTypeReference propertyTypeReference)

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.

public static EdmTypeKind TypeKind(this IEdmTypeReference type)

Gets the type kind of the type references definition.

Gets an annotatable element's vocabulary annotations as seen from a particular model.