Jazyk

DataServiceConfiguration Třída

Definice

Spravuje konfiguraci datových služeb WCF.

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
Dědičnost
DataServiceConfiguration
Implementuje

Příklady

Tento příklad ukazuje stránku kódu pro datovou službu založenou na Northwindu s přístupem uděleným vybraným sadám entit.

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

Vlastnosti

Name Description
DataServiceBehavior

DataServiceBehavior Získá objekt, který definuje další chování datové služby.

EnableTypeConversion

Získá nebo nastaví, zda modul runtime datové služby má převést typ, který je obsažen v datové části na skutečný typ vlastnosti, který je zadán v požadavku.

MaxBatchCount

Získá nebo nastaví maximální počet sad změn a dotazovací operace, které jsou povoleny v jedné dávce.

MaxChangesetCount

Získá nebo nastaví maximální počet změn, které lze zahrnout do jedné sady změn.

MaxExpandCount

Získá nebo nastaví maximální počet souvisejících entit, které lze zahrnout do jednoho požadavku pomocí operátoru $expand .

MaxExpandDepth

Získejte nebo nastavíte maximální počet souvisejících entit, které lze zahrnout do $expand cesty v jednom požadavku.

MaxObjectCountOnInsert

Získejte nebo nastaví maximální počet objektů, které se mají vložit, které mohou být obsaženy v jednom požadavku POST.

MaxResultsPerCollection

Získá nebo nastaví maximální počet položek v každé vrácené kolekci.

UseVerboseErrors

Získá nebo nastaví, zda podrobné chyby mají být vráceny datovou službou.

Metody

Name Description
EnableTypeAccess(String)

Zaregistruje datový typ v modulu runtime datové služby, aby ho mohl používat vlastní poskytovatel datových služeb.

Equals(Object)

Určuje, zda je zadaný objekt roven aktuálnímu objektu.

(Zděděno od Object)
GetHashCode()

Slouží jako výchozí funkce hash.

(Zděděno od Object)
GetType()

Získá Type aktuální instance.

(Zděděno od Object)
MemberwiseClone()

Vytvoří mělkou kopii aktuálního Object.

(Zděděno od Object)
RegisterKnownType(Type)

Přidá typ do seznamu typů rozpoznaných datovou službou.

SetEntitySetAccessRule(String, EntitySetRights)

Nastaví oprávnění pro zadaný prostředek sady entit.

SetEntitySetPageSize(String, Int32)

Nastaví maximální velikost stránky pro prostředek sady entit.

SetServiceOperationAccessRule(String, ServiceOperationRights)

Nastaví oprávnění pro zadanou operaci služby.

ToString()

Vrátí řetězec, který představuje aktuální objekt.

(Zděděno od Object)

Platí pro

Viz také