This documentation is archived and is not being maintained.

DataServiceConfiguration::EnableTypeAccess Method

Registers a data type with the data service runtime so that it can be used by a custom data service provider.

Namespace:  System.Data.Services
Assembly:  System.Data.Services (in System.Data.Services.dll)

void EnableTypeAccess(
	String^ typeName


Type: System::String
The namespace-qualified name of the type that is enabled for use with the custom data service provider.

The EnableTypeAccess method is used to register a type with the data service runtime. After registration, a type can be returned in the properties of an open type. This makes the type visible in $metadata output and usable by the data service.

The supplied typeName must be defined in the same format as a type in the data model and not as a CLR type. The registered types are added to those types already made available by calling the SetEntitySetAccessRule method.

The data service runtime cannot determine what kind of data type the typeName maps to until information about the type can be obtained from the underlying provider.

A value of '*' can be supplied for typeName, which matches all types.

When the data service runtime enumerates types or must obtain a type from the underlying data provider, it must first determine whether the type must be visible when the SetEntitySetAccessRule method is called. When the type is not available in this manner, then types registered by using the EnableTypeAccess method are checked. When a type is not made visible by using either of these mechanisms, that type is not included in the response to a $metadata request, and instances of that type are not returned to the client as the response of a request to the data service.

The EnableTypeAccess method can be called many times with the same type name.

.NET Framework

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.