DataServiceConfiguration DataServiceConfiguration DataServiceConfiguration DataServiceConfiguration Class

Definición

Administra la configuración de WCF Data Services.Manages the configuration of WCF Data Services.

public ref class DataServiceConfiguration sealed : System::Data::Services::IDataServiceConfiguration
public sealed class DataServiceConfiguration : System.Data.Services.IDataServiceConfiguration
type DataServiceConfiguration = class
    interface IDataServiceConfiguration
Public NotInheritable Class DataServiceConfiguration
Implements IDataServiceConfiguration
Herencia
DataServiceConfigurationDataServiceConfigurationDataServiceConfigurationDataServiceConfiguration
Implementaciones

Ejemplos

En este ejemplo se muestra la página de código subyacente para un servicio de datos basado en Northwind, con acceso concedido a los conjuntos de entidades seleccionados.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);
        }
    }

}
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

Propiedades

DataServiceBehavior DataServiceBehavior DataServiceBehavior DataServiceBehavior

Obtiene un objeto DataServiceBehavior que define comportamientos adicionales del servicio de datos.Gets a DataServiceBehavior object that defines additional behaviors of the data service.

EnableTypeConversion EnableTypeConversion EnableTypeConversion EnableTypeConversion

Obtiene o establece un valor que indica si el runtime del servicio de datos debe convertir el tipo contenido en la carga en el tipo de propiedad real que se especifica en la solicitud.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 MaxBatchCount MaxBatchCount MaxBatchCount

Obtiene o establece el número máximo de conjuntos de cambios y operaciones de consulta que se permiten en un solo lote.Gets or sets the maximum number of change sets and query operations that are allowed in a single batch.

MaxChangesetCount MaxChangesetCount MaxChangesetCount MaxChangesetCount

Obtiene o establece el número máximo de cambios que se pueden incluir en un solo conjunto de cambios.Gets or set the maximum number of changes that can be included in a single change set.

MaxExpandCount MaxExpandCount MaxExpandCount MaxExpandCount

Obtiene o establece el número máximo de entidades relacionadas que se pueden incluir en una sola solicitud con el operador $expand.Gets or sets the maximum number of related entities that can be included in a single request by using the $expand operator.

MaxExpandDepth MaxExpandDepth MaxExpandDepth MaxExpandDepth

Obtiene o establece el número máximo de entidades relacionadas que se pueden incluir en una ruta $expand de una sola solicitud.Get or sets the maximum number of related entities that can be included in an $expand path in a single request.

MaxObjectCountOnInsert MaxObjectCountOnInsert MaxObjectCountOnInsert MaxObjectCountOnInsert

Obtiene o establece el número máximo de objetos que pueden insertarse en una sola solicitud POST.Get or sets the maximum number of objects to insert that can be contained in a single POST request.

MaxResultsPerCollection MaxResultsPerCollection MaxResultsPerCollection MaxResultsPerCollection

Obtiene o establece el número máximo de elementos de cada colección devuelta.Get or sets the maximum number of items in each returned collection.

UseVerboseErrors UseVerboseErrors UseVerboseErrors UseVerboseErrors

Obtiene o establece un valor que indica si el servicio de datos debe devolver errores detallados.Gets or sets whether verbose errors should be returned by the data service.

Métodos

EnableTypeAccess(String) EnableTypeAccess(String) EnableTypeAccess(String) EnableTypeAccess(String)

Registra un tipo de datos con el runtime del servicio de datos de modo que lo pueda usar un proveedor de servicios de datos personalizado.Registers a data type with the data service runtime so that it can be used by a custom data service provider.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determina si el objeto especificado es igual al objeto actual.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Sirve como la función hash predeterminada.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Obtiene el Type de la instancia actual.Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Crea una copia superficial del objeto Object actual.Creates a shallow copy of the current Object.

(Inherited from Object)
RegisterKnownType(Type) RegisterKnownType(Type) RegisterKnownType(Type) RegisterKnownType(Type)

Agrega un tipo a la lista de tipos reconocidos por el servicio de datos.Adds a type to the list of types that are recognized by the data service.

SetEntitySetAccessRule(String, EntitySetRights) SetEntitySetAccessRule(String, EntitySetRights) SetEntitySetAccessRule(String, EntitySetRights) SetEntitySetAccessRule(String, EntitySetRights)

Establece los permisos para el recurso de conjunto de entidades especificado.Sets the permissions for the specified entity set resource.

SetEntitySetPageSize(String, Int32) SetEntitySetPageSize(String, Int32) SetEntitySetPageSize(String, Int32) SetEntitySetPageSize(String, Int32)

Establece el tamaño de página máximo de un recurso de conjunto de entidades.Sets the maximum page size for an entity set resource.

SetServiceOperationAccessRule(String, ServiceOperationRights) SetServiceOperationAccessRule(String, ServiceOperationRights) SetServiceOperationAccessRule(String, ServiceOperationRights) SetServiceOperationAccessRule(String, ServiceOperationRights)

Establece los permisos para la operación de servicio especificada.Sets the permissions for the specified service operation.

ToString() ToString() ToString() ToString()

Devuelve una cadena que representa el objeto actual.Returns a string that represents the current object.

(Inherited from Object)

Se aplica a

Consulte también: