Share via


ODataConventionModelBuilder Class

 

ODataConventionModelBuilder is used to automatically map CLR classes to an EDM model based on a set of T:System.Web.OData.Builder.Conventions.IConvention.

Namespace:   System.Web.OData.Builder
Assembly:  System.Web.OData (in System.Web.OData.dll)

Inheritance Hierarchy

System.Object
  System.Web.OData.Builder.ODataModelBuilder
    System.Web.OData.Builder.ODataConventionModelBuilder

Syntax

public class ODataConventionModelBuilder : ODataModelBuilder
public ref class ODataConventionModelBuilder : ODataModelBuilder
type ODataConventionModelBuilder = 
    class
        inherit ODataModelBuilder
    end
Public Class ODataConventionModelBuilder
    Inherits ODataModelBuilder

Constructors

Name Description
System_CAPS_pubmethod ODataConventionModelBuilder()

Initializes a new instance of the ODataConventionModelBuilder class.

System_CAPS_pubmethod ODataConventionModelBuilder(HttpConfiguration)

Initializes a new ODataConventionModelBuilder.

System_CAPS_pubmethod ODataConventionModelBuilder(HttpConfiguration, Boolean)

Initializes a new instance of the ODataConventionModelBuilder class.

Properties

Name Description
System_CAPS_pubproperty ContainerName

Gets or sets the name of the container that will hold all the navigation sources, actions and functions (Inherited from ODataModelBuilder.)

System_CAPS_pubproperty DataServiceVersion

Gets or sets the data service version of the model. The default value is 4.0. (Inherited from ODataModelBuilder.)

System_CAPS_pubproperty EntitySets

Gets the collection of EDM entity sets in the model to be built. (Inherited from ODataModelBuilder.)

System_CAPS_pubproperty EnumTypes

Gets the collection of EDM types in the model to be built. (Inherited from ODataModelBuilder.)

System_CAPS_pubproperty MaxDataServiceVersion

Gets or sets the maximum data service version of the model. The default value is 4.0. (Inherited from ODataModelBuilder.)

System_CAPS_pubproperty ModelAliasingEnabled

Gets or sets if model aliasing is enabled or not. The default value is true.

System_CAPS_pubproperty Namespace

Gets or sets the namespace that will be used for the resulting model (Inherited from ODataModelBuilder.)

System_CAPS_pubproperty NavigationSources

Gets the collection of EDM navigation sources (entity sets and singletons) in the model to be built. (Inherited from ODataModelBuilder.)

System_CAPS_pubproperty OnModelCreating

This action is invoked after the ODataConventionModelBuilder has run all the conventions, but before the configuration is locked down and used to build the IEdmModel.

System_CAPS_pubproperty Procedures

Gets the collection of Procedures (i.e. Actions, Functions and ServiceOperations) in the model to be built. (Inherited from ODataModelBuilder.)

System_CAPS_pubproperty Singletons

Gets the collection of EDM singletons in the model to be built. (Inherited from ODataModelBuilder.)

System_CAPS_pubproperty StructuralTypes

Gets the collection of EDM types in the model to be built. (Inherited from ODataModelBuilder.)

Methods

Name Description
System_CAPS_pubmethod Action(String)

Adds an unbound action to the builder. (Inherited from ODataModelBuilder.)

System_CAPS_pubmethod AddComplexType(Type)

(Overrides ODataModelBuilder.AddComplexType(Type).)

System_CAPS_pubmethod AddEntitySet(String, EntityTypeConfiguration)

(Overrides ODataModelBuilder.AddEntitySet(String, EntityTypeConfiguration).)

System_CAPS_pubmethod AddEntityType(Type)

(Overrides ODataModelBuilder.AddEntityType(Type).)

System_CAPS_pubmethod AddEnumType(Type)

(Overrides ODataModelBuilder.AddEnumType(Type).)

System_CAPS_pubmethod AddProcedure(ProcedureConfiguration)

Adds a procedure to the model. (Inherited from ODataModelBuilder.)

System_CAPS_pubmethod AddSingleton(String, EntityTypeConfiguration)

(Overrides ODataModelBuilder.AddSingleton(String, EntityTypeConfiguration).)

System_CAPS_pubmethod ComplexType<TComplexType>()

Registers a type as a complex type in the model and returns an object that can be used to configure the complex type. This method can be called multiple times for the same type to perform multiple lines of configuration. (Inherited from ODataModelBuilder.)

System_CAPS_pubmethod EntitySet<TEntityType>(String)

Registers an entity set as a part of the model and returns an object that can be used to configure the entity set. This method can be called multiple times for the same type to perform multiple lines of configuration. (Inherited from ODataModelBuilder.)

System_CAPS_pubmethod EntityType<TEntityType>()

Registers an entity type as part of the model and returns an object that can be used to configure the entity type. This method can be called multiple times for the same entity to perform multiple lines of configuration. (Inherited from ODataModelBuilder.)

System_CAPS_pubmethod EnumType<TEnumType>()

Registers an enum type as part of the model and returns an object that can be used to configure the enum. (Inherited from ODataModelBuilder.)

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod Function(String)

Adds an unbound function to the builder. (Inherited from ODataModelBuilder.)

System_CAPS_pubmethod GetEdmModel()

(Overrides ODataModelBuilder.GetEdmModel().)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_pubmethod GetTypeConfigurationOrNull(Type)

Attempts to find a pre-configured structural type or a primitive type or an enum type that matches the T. If no matches are found NULL is returned. (Inherited from ODataModelBuilder.)

System_CAPS_pubmethod Ignore(Type[])

Excludes a type or types from the model. This is used to remove types from the model that were added by convention during initial model discovery.

System_CAPS_pubmethod Ignore<T>()

Excludes a type from the model. This is used to remove types from the model that were added by convention during initial model discovery.

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod RemoveEntitySet(String)

Removes the entity set from the model. (Inherited from ODataModelBuilder.)

System_CAPS_pubmethod RemoveEnumType(Type)

Removes the type from the model. (Inherited from ODataModelBuilder.)

System_CAPS_pubmethod RemoveProcedure(ProcedureConfiguration)

Remove the procedure from the model (Inherited from ODataModelBuilder.)

System_CAPS_pubmethod RemoveProcedure(String)

Remove the procedure from the model

Remarks

If there is more than one procedure with the name specified this method will not work. You need to use the other RemoveProcedure(..) overload instead.

(Inherited from ODataModelBuilder.)
System_CAPS_pubmethod RemoveSingleton(String)

Removes the singleton from the model. (Inherited from ODataModelBuilder.)

System_CAPS_pubmethod RemoveStructuralType(Type)

Removes the type from the model. (Inherited from ODataModelBuilder.)

System_CAPS_pubmethod Singleton<TEntityType>(String)

Registers a singleton as a part of the model and returns an object that can be used to configure the singleton. This method can be called multiple times for the same type to perform multiple lines of configuration. (Inherited from ODataModelBuilder.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

System_CAPS_pubmethod ValidateModel(IEdmModel)

(Overrides ODataModelBuilder.ValidateModel(IEdmModel).)

Extension Methods

Name Description
System_CAPS_pubmethod EnableLowerCamelCase()

Overloaded. Enable lower camel case with default NameResolverOptions NameResolverOptions.ProcessReflectedPropertyNames | NameResolverOptions.ProcessDataMemberAttributePropertyNames | NameResolverOptions.ProcessExplicitPropertyNames.(Defined by ODataConventionModelBuilderExtensions.)

System_CAPS_pubmethod EnableLowerCamelCase(NameResolverOptions)

Overloaded. Enable lower camel case with given NameResolverOptions.(Defined by ODataConventionModelBuilderExtensions.)

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

System.Web.OData.Builder Namespace

Return to top