DataServiceConfiguration Class
.NET Framework 4.5
Manages the configuration of WCF Data Services.
Namespace: System.Data.Services
Assembly: System.Data.Services (in System.Data.Services.dll)
The DataServiceConfiguration type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | DataServiceBehavior | Gets a DataServiceBehavior object that defines additional behaviors of the data service. |
![]() | EnableTypeConversion | 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. |
![]() | MaxBatchCount | Gets or sets the maximum number of change sets and query operations that are allowed in a single batch. |
![]() | MaxChangesetCount | Gets or set the maximum number of changes that can be included in a single change set. |
![]() | MaxExpandCount | Gets or sets the maximum number of related entities that can be included in a single request by using the $expand operator. |
![]() | MaxExpandDepth | Get or sets the maximum number of related entities that can be included in an $expand path in a single request. |
![]() | MaxObjectCountOnInsert | Get or sets the maximum number of objects to insert that can be contained in a single POST request. |
![]() | MaxResultsPerCollection | Get or sets the maximum number of items in each returned collection. |
![]() | UseVerboseErrors | Gets or sets whether verbose errors should be returned by the data service. |
| Name | Description | |
|---|---|---|
![]() | EnableTypeAccess | Registers a data type with the data service runtime so that it can be used by a custom data service provider. |
![]() | Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | RegisterKnownType | Adds a type to the list of types that are recognized by the data service. |
![]() | SetEntitySetAccessRule | Sets the permissions for the specified entity set resource. |
![]() | SetEntitySetPageSize | Sets the maximum page size for an entity set resource. |
![]() | SetServiceOperationAccessRule | Sets the permissions for the specified service operation. |
![]() | ToString | 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.
using System.Data.Services; using System.Linq; using System.ServiceModel.Web; namespace NorthwindService { public class Northwind : DataService<NorthwindEntities> { // This method is called only once to initialize service-wide policies. public static void InitializeService(DataServiceConfiguration config) { // Grant only the rights needed to support the client application. config.SetEntitySetAccessRule("Orders", EntitySetRights.AllRead | EntitySetRights.WriteMerge | EntitySetRights.WriteReplace ); config.SetEntitySetAccessRule("Order_Details", EntitySetRights.AllRead | EntitySetRights.AllWrite); config.SetEntitySetAccessRule("Customers", EntitySetRights.AllRead); } } }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
