DataServiceConfiguration Class

 

Manages the configuration of WCF Data Services.

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

System.Object
  System.Data.Services.DataServiceConfiguration

Public NotInheritable Class DataServiceConfiguration
	Implements IDataServiceConfiguration

NameDescription
System_CAPS_pubpropertyDataServiceBehavior

Gets a DataServiceBehavior object that defines additional behaviors of the data service.

System_CAPS_pubpropertyEnableTypeConversion

Gets or sets whether the data service runtime should convert the type that is contained in the payload to the actual property type that is specified in the request.

System_CAPS_pubpropertyMaxBatchCount

Gets or sets the maximum number of change sets and query operations that are allowed in a single batch.

System_CAPS_pubpropertyMaxChangesetCount

Gets or set the maximum number of changes that can be included in a single change set.

System_CAPS_pubpropertyMaxExpandCount

Gets or sets the maximum number of related entities that can be included in a single request by using the $expand operator.

System_CAPS_pubpropertyMaxExpandDepth

Get or sets the maximum number of related entities that can be included in an $expand path in a single request.

System_CAPS_pubpropertyMaxObjectCountOnInsert

Get or sets the maximum number of objects to insert that can be contained in a single POST request.

System_CAPS_pubpropertyMaxResultsPerCollection

Get or sets the maximum number of items in each returned collection.

System_CAPS_pubpropertyUseVerboseErrors

Gets or sets whether verbose errors should be returned by the data service.

NameDescription
System_CAPS_pubmethodEnableTypeAccess(String)

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

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodRegisterKnownType(Type)

Adds a type to the list of types that are recognized by the data service.

System_CAPS_pubmethodSetEntitySetAccessRule(String, EntitySetRights)

Sets the permissions for the specified entity set resource.

System_CAPS_pubmethodSetEntitySetPageSize(String, Int32)

Sets the maximum page size for an entity set resource.

System_CAPS_pubmethodSetServiceOperationAccessRule(String, ServiceOperationRights)

Sets the permissions for the specified service operation.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

This example shows the code-behind page for a Northwind-based data service, with access granted to selected entity sets.

Imports System.Data.Services
Imports System.Linq
Imports System.ServiceModel.Web

Public Class Northwind
    Inherits DataService(Of NorthwindEntities)

    ' This method is called only once to initialize service-wide policies.
    Public Shared Sub InitializeService(ByVal config As DataServiceConfiguration)
        ' Grant only the rights needed to support the client application.
        config.SetEntitySetAccessRule("Orders", EntitySetRights.AllRead _
             Or EntitySetRights.WriteMerge _
             Or EntitySetRights.WriteReplace)
        config.SetEntitySetAccessRule("Order_Details", EntitySetRights.AllRead _
            Or EntitySetRights.AllWrite)
        config.SetEntitySetAccessRule("Customers", EntitySetRights.AllRead)
    End Sub
End Class

.NET Framework
Available since 3.5

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

Return to top
Show: