Share via


EdmModel Class

Definition

Represents an EDM model.

public class EdmModel : Microsoft.OData.Edm.EdmModelBase
type EdmModel = class
    inherit EdmModelBase
Public Class EdmModel
Inherits EdmModelBase
Inheritance

Constructors

EdmModel()

Initializes a new instance of the EdmModel class.

EdmModel(Boolean)

Initializes a new instance of the EdmModel class.

Properties

DeclaredNamespaces

Gets the collection of namespaces that schema elements use contained in this model.

DirectValueAnnotationsManager

Gets the model's annotations manager.

(Inherited from EdmModelBase)
EntityContainer

Gets the only one entity container of the model.

(Inherited from EdmModelBase)
ReferencedModels

Gets the collection of models referred to by this model.

(Inherited from EdmModelBase)
SchemaElements

Gets the collection of schema elements that are contained in this model and referenced models.

VocabularyAnnotations

Gets the collection of vocabulary annotations that are contained in this model.

Methods

AddElement(IEdmSchemaElement)

Adds a schema element to this model.

AddElements(IEnumerable<IEdmSchemaElement>)

Adds a collection of schema elements to this model.

AddReferencedModel(IEdmModel)

Adds a model reference to this model.

AddVocabularyAnnotation(IEdmVocabularyAnnotation)

Adds a vocabulary annotation to this model.

FindDeclaredBoundOperations(IEdmType)

Searches for bound operations based on the binding type, returns an empty enumerable if no operation exists.

(Inherited from EdmModelBase)
FindDeclaredBoundOperations(String, IEdmType)

Searches for bound operations based on the qualified name and binding type, returns an empty enumerable if no operation exists.

(Inherited from EdmModelBase)
FindDeclaredOperations(String)

Searches for a operation with the given name in this model and returns null if no such operation exists.

(Inherited from EdmModelBase)
FindDeclaredTerm(String)

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

(Inherited from EdmModelBase)
FindDeclaredType(String)

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

(Inherited from EdmModelBase)
FindDeclaredVocabularyAnnotations(IEdmVocabularyAnnotatable)

Searches for vocabulary annotations specified by this model.

FindDirectlyDerivedTypes(IEdmStructuredType)

Finds a list of types that derive directly from the supplied type.

RegisterElement(IEdmSchemaElement)

Adds a schema element to this model.

(Inherited from EdmModelBase)
SetVocabularyAnnotation(IEdmVocabularyAnnotation)

Set a vocabulary annotation to this model.

Extension Methods

TryWriteSchema(IEdmModel, Func<String,XmlWriter>, IEnumerable<EdmError>)

Outputs Schema artifacts to the provided writers.

TryWriteSchema(IEdmModel, XmlWriter, IEnumerable<EdmError>)

Outputs a Schema artifact to the provided writer.

GetEdmxVersion(IEdmModel)

Gets the value for the EDMX version of the model.

GetNamespaceAlias(IEdmModel, String)

Gets the serialization alias for a given namespace.

GetNamespacePrefixMappings(IEdmModel)

Gets the preferred prefix mappings for xml namespaces from an IEdmModel

SetEdmxVersion(IEdmModel, Version)

Sets a value of EDMX version attribute of the model.

SetNamespaceAlias(IEdmModel, String, String)

Sets the serialization alias for a given namespace(including current model's schemas namespace-alias, and referenced models' schemas namespace-alias) TODO: REF make sure no duplicated alias.

SetNamespacePrefixMappings(IEdmModel, IEnumerable<KeyValuePair<String,String>>)

Sets an annotation on the IEdmModel to notify the serializer of preferred prefix mappings for xml namespaces.

GetMimeType(IEdmModel, IEdmOperation)

Checks whether the annotatableOperation has a MIME type annotation.

GetMimeType(IEdmModel, IEdmProperty)

Checks whether the annotatableProperty has a MIME type annotation.

SetMimeType(IEdmModel, IEdmOperation, String)

Sets the MIME type annotation of the annotatableOperation to mimeType.

SetMimeType(IEdmModel, IEdmProperty, String)

Sets the MIME type annotation of the annotatableProperty to mimeType.

AddAlternateKeyAnnotation(EdmModel, IEdmEntityType, IDictionary<String,IEdmProperty>)

Adds the alternate keys to this entity type.

AddComplexType(EdmModel, String, String, IEdmComplexType, Boolean, Boolean)

Creates and adds a complex type to the model.

AddComplexType(EdmModel, String, String, IEdmComplexType, Boolean)

Creates and adds a complex type to the model.

AddComplexType(EdmModel, String, String, IEdmComplexType)

Creates and adds a complex type to the model.

AddComplexType(EdmModel, String, String)

Creates and adds a complex type to the model.

AddEntityContainer(EdmModel, String, String)

Creates and adds an entity container to the model.

AddEntityType(EdmModel, String, String, IEdmEntityType, Boolean, Boolean, Boolean)

Creates and adds an entity type to the model.

AddEntityType(EdmModel, String, String, IEdmEntityType, Boolean, Boolean)

Creates and adds an entity type to the model.

AddEntityType(EdmModel, String, String, IEdmEntityType)

Creates and adds an entity type to the model.

AddEntityType(EdmModel, String, String)

Creates and adds an entity type to the model.

AddTerm(EdmModel, String, String, EdmPrimitiveTypeKind)

Creates and adds a new instance of the EdmTerm class from a primitive type kind.

AddTerm(EdmModel, String, String, IEdmTypeReference, String, String)

Creates and adds a new instance of the EdmTerm class from a type reference.

AddTerm(EdmModel, String, String, IEdmTypeReference)

Creates and adds a new instance of the EdmTerm class from a type reference.

DirectValueAnnotations(IEdmModel, IEdmElement)

Gets the direct annotations for an element.

ExistsContainer(IEdmModel, String)

If the container name in the model is the same as the input name. The input name maybe full qualified name.

FindAllDerivedTypes(IEdmModel, IEdmStructuredType)

Finds a list of types that derive from the supplied type directly or indirectly, and across models.

FindBoundOperations(IEdmModel, IEdmType)

Searches for bound operations based on the binding type, returns an empty enumerable if no operation exists.

FindBoundOperations(IEdmModel, String, IEdmType)

Searches for bound operations based on the qualified name and binding type, returns an empty enumerable if no operation exists.

FindDeclaredEntitySet(IEdmModel, String)

Searches for entity set by the given name that may be container qualified in default container and .Extends containers.

FindDeclaredNavigationSource(IEdmModel, String)

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.

FindDeclaredOperationImports(IEdmModel, String)

Searches for the operation imports by the specified name in default container and .Extends containers, returns an empty enumerable if no operation import exists.

FindDeclaredSingleton(IEdmModel, String)

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.

FindEntityContainer(IEdmModel, String)

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.

FindOperations(IEdmModel, String)

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

FindTerm(IEdmModel, String)

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

FindType(IEdmModel, String)

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

FindVocabularyAnnotations(IEdmModel, IEdmVocabularyAnnotatable)

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

FindVocabularyAnnotations<T>(IEdmModel, IEdmVocabularyAnnotatable, IEdmTerm, String)

Gets an annotatable element's vocabulary annotations that bind a particular term.

FindVocabularyAnnotations<T>(IEdmModel, IEdmVocabularyAnnotatable, IEdmTerm)

Gets an annotatable element's vocabulary annotations that bind a particular term.

FindVocabularyAnnotations<T>(IEdmModel, IEdmVocabularyAnnotatable, String, String)

Gets an annotatable element's vocabulary annotations that bind a particular term.

FindVocabularyAnnotations<T>(IEdmModel, IEdmVocabularyAnnotatable, String)

Gets an annotatable element's vocabulary annotations that bind a particular term.

FindVocabularyAnnotationsIncludingInheritedAnnotations(IEdmModel, IEdmVocabularyAnnotatable)

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

GetAlternateKeysAnnotation(IEdmModel, IEdmEntityType)

Gets the declared alternate keys of the most defined entity with a declared key present.

GetAnnotationValue(IEdmModel, IEdmElement, String, String)

Gets an annotation value corresponding to the given namespace and name provided.

GetAnnotationValue<T>(IEdmModel, IEdmElement, String, String)

Gets an annotation value corresponding to the given namespace and name provided.

GetAnnotationValue<T>(IEdmModel, IEdmElement)

Gets an annotation value from an annotatable element.

GetAnnotationValues(IEdmModel, IEnumerable<IEdmDirectValueAnnotationBinding>)

Retrieves a set of annotation values. For each requested value, returns null if no annotation with the given name exists for the given element.

GetDerivedTypeConstraints(IEdmModel, IEdmNavigationSource)

Gets the collection of qualified type name for term Org.OData.Validation.V1.DerivedTypeConstraint from a navigation source.

GetDerivedTypeConstraints(IEdmModel, IEdmVocabularyAnnotatable)

Gets the collection of qualified type name for term Org.OData.Validation.V1.DerivedTypeConstraint from a target annotatable.

GetDescriptionAnnotation(IEdmModel, IEdmVocabularyAnnotatable)

Gets description for term Org.OData.Core.V1.Description from a target annotatable

GetEdmReferences(IEdmModel)

Gets edmx:Reference information (IEdmReference) from the model.

GetEdmVersion(IEdmModel)

Gets the value for the EDM version of the model.

GetLongDescriptionAnnotation(IEdmModel, IEdmVocabularyAnnotatable)

Gets description for term Org.OData.Core.V1.LongDescription from a target annotatable

GetPrimitiveValueConverter(IEdmModel, IEdmTypeReference)

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

GetTermValue(IEdmModel, IEdmStructuredValue, IEdmTerm, EdmExpressionEvaluator)

Gets the IEdmValue of a vocabulary term that has been applied to the type of a value.

GetTermValue(IEdmModel, IEdmStructuredValue, IEdmTerm, String, EdmExpressionEvaluator)

Gets the IEdmValue of a vocabulary term that has been applied to the type of a value.

GetTermValue(IEdmModel, IEdmStructuredValue, String, EdmExpressionEvaluator)

Gets the IEdmValue of a vocabulary term that has been applied to the type of a value.

GetTermValue(IEdmModel, IEdmStructuredValue, String, String, EdmExpressionEvaluator)

Gets the IEdmValue of a vocabulary term that has been applied to the type of a value.

GetTermValue(IEdmModel, IEdmVocabularyAnnotatable, IEdmTerm, EdmExpressionEvaluator)

Gets the IEdmValue of a vocabulary term that has been applied to an element.

GetTermValue(IEdmModel, IEdmVocabularyAnnotatable, IEdmTerm, String, EdmExpressionEvaluator)

Gets the IEdmValue of a vocabulary term that has been applied to an element.

GetTermValue(IEdmModel, IEdmVocabularyAnnotatable, String, EdmExpressionEvaluator)

Gets the IEdmValue of a vocabulary term that has been applied to an element.

GetTermValue(IEdmModel, IEdmVocabularyAnnotatable, String, String, EdmExpressionEvaluator)

Gets the IEdmValue of a vocabulary term that has been applied to an element.

GetTermValue<T>(IEdmModel, IEdmStructuredValue, IEdmTerm, EdmToClrEvaluator)

Gets the CLR value of a vocabulary term that has been applied to the type of a value.

GetTermValue<T>(IEdmModel, IEdmStructuredValue, IEdmTerm, String, EdmToClrEvaluator)

Gets the CLR value of a vocabulary term that has been applied to the type of a value.

GetTermValue<T>(IEdmModel, IEdmStructuredValue, String, EdmToClrEvaluator)

Gets the CLR value of a vocabulary term that has been applied to the type of a value.

GetTermValue<T>(IEdmModel, IEdmStructuredValue, String, String, EdmToClrEvaluator)

Gets the CLR value of a vocabulary term that has been applied to the type of a value.

GetTermValue<T>(IEdmModel, IEdmVocabularyAnnotatable, IEdmTerm, EdmToClrEvaluator)

Gets the CLR value of a vocabulary term that has been applied to an element.

GetTermValue<T>(IEdmModel, IEdmVocabularyAnnotatable, IEdmTerm, String, EdmToClrEvaluator)

Gets the CLR value of a vocabulary term that has been applied to an element.

GetTermValue<T>(IEdmModel, IEdmVocabularyAnnotatable, String, EdmToClrEvaluator)

Gets the CLR value of a vocabulary term that has been applied to an element.

GetTermValue<T>(IEdmModel, IEdmVocabularyAnnotatable, String, String, EdmToClrEvaluator)

Gets the CLR value of a vocabulary term that has been applied to an element.

GetUInt16(EdmModel, String, Boolean)

Get type reference to the default UInt16 type definition. The default underlying type is Microsoft.OData.Edm.PrimitiveValueConverterConstants.DefaultUInt16UnderlyingType. If the user has already defined his own UInt16, this method will not define anything and simply returns the type reference.

GetUInt32(EdmModel, String, Boolean)

Get type reference to the default UInt32 type definition. The default underlying type is Microsoft.OData.Edm.PrimitiveValueConverterConstants.DefaultUInt32UnderlyingType. If the user has already defined his own UInt32, this method will not define anything and simply returns the type reference.

GetUInt64(EdmModel, String, Boolean)

Get type reference to the default UInt64 type definition. The default underlying type is Microsoft.OData.Edm.PrimitiveValueConverterConstants.DefaultUInt64UnderlyingType. If the user has already defined his own UInt64, this method will not define anything and simply returns the type reference.

Location(IEdmElement)

Gets the location of this element.

SchemaElementsAcrossModels(IEdmModel)

Gets all schema elements from the model, and models referenced by it.

SetAnnotationValue(IEdmModel, IEdmElement, String, String, Object)

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.

SetAnnotationValue<T>(IEdmModel, IEdmElement, T)

Sets an annotation value on an annotatable element.

SetAnnotationValues(IEdmModel, IEnumerable<IEdmDirectValueAnnotationBinding>)

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.

SetChangeTrackingAnnotation(EdmModel, IEdmEntityContainer, Boolean)

Set Org.OData.Capabilities.V1.ChangeTracking to target.

SetChangeTrackingAnnotation(EdmModel, IEdmEntitySet, Boolean, IEnumerable<IEdmStructuralProperty>, IEnumerable<IEdmNavigationProperty>)

Set Org.OData.Capabilities.V1.ChangeTracking to target.

SetDescriptionAnnotation(EdmModel, IEdmVocabularyAnnotatable, String)

Set Org.OData.Core.V1.Description to target.

SetEdmReferences(IEdmModel, IEnumerable<IEdmReference>)

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

SetEdmVersion(IEdmModel, Version)

Sets a value of EDM version attribute of the model.

SetLongDescriptionAnnotation(EdmModel, IEdmVocabularyAnnotatable, String)

Set Org.OData.Core.V1.LongDescription to target.

SetOptimisticConcurrencyAnnotation(EdmModel, IEdmEntitySet, IEnumerable<IEdmStructuralProperty>)

Set annotation Org.OData.Core.V1.OptimisticConcurrency to EntitySet

SetPrimitiveValueConverter(IEdmModel, IEdmTypeDefinitionReference, IPrimitiveValueConverter)

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

TryFindContainerQualifiedEntitySet(IEdmModel, String, IEdmEntitySet)

Finds the entity set with qualified entity set name (not simple entity set name).

TryFindContainerQualifiedOperationImports(IEdmModel, String, IEnumerable<IEdmOperationImport>)

Tries the find container qualified operation imports.

TryFindContainerQualifiedSingleton(IEdmModel, String, IEdmSingleton)

Finds the singleton.

Validate(IEdmModel, ValidationRuleSet, IEnumerable<EdmError>)

Validate the IEdmModel and all of its properties given certain version.

Validate(IEdmModel, IEnumerable<EdmError>)

Validate the IEdmModel and all of its properties using the current version of the model. If the model has no version, EdmVersionDefault is used.

Validate(IEdmModel, Version, IEnumerable<EdmError>)

Validate the IEdmModel and all of its properties given certain version.

Errors(IEdmElement)

Gets the errors, if any, that belong to this element or elements that this element contains. For example errors for a structural type include the errors of the type itself and errors of its declared properties. The method does not analyze elements referenced by this element. For example errors of a property do not include errors from its type.

IsBad(IEdmElement)

Returns true if this element contains errors returned by the Errors(IEdmElement) method.

GetVocabularyStringCollection(IEdmModel, IEdmVocabularyAnnotatable, IEdmTerm)

Gets the collection of string for a target annotatable.

Applies to