ODataModelBuilder.AddSingleton Method (String, EntityTypeConfiguration)
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.
Namespace: System.Web.OData.Builder
Assembly: System.Web.OData (in System.Web.OData.dll)
Syntax
public virtual SingletonConfiguration AddSingleton(
string name,
EntityTypeConfiguration entityType
)
public:
virtual SingletonConfiguration^ AddSingleton(
String^ name,
EntityTypeConfiguration^ entityType
)
abstract AddSingleton :
name:string *
entityType:EntityTypeConfiguration -> SingletonConfiguration
override AddSingleton :
name:string *
entityType:EntityTypeConfiguration -> SingletonConfiguration
Public Overridable Function AddSingleton (
name As String,
entityType As EntityTypeConfiguration
) As SingletonConfiguration
Parameters
name
Type: System.StringThe name of the singleton.
entityType
Type: System.Web.OData.Builder.EntityTypeConfigurationThe type to be registered or configured.
Return Value
Type: System.Web.OData.Builder.SingletonConfiguration
The configuration object for the specified singleton.
See Also
ODataModelBuilder Class
System.Web.OData.Builder Namespace
Return to top