C# Класс DataServiceProvider.DSPMetadata

Metadata definition for the DSP. This also implements the IDataServiceMetadataProvider.
Наследование: IDataServiceMetadataProvider, ICloneable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddCollectionProperty ( System.Data.Services.Providers.ResourceType resourceType, string name, System.Data.Services.Providers.ResourceType itemType ) : void

Adds a collection of complex or primitive items property.

AddCollectionProperty ( System.Data.Services.Providers.ResourceType resourceType, string name, Type itemType ) : void

Adds a collection of primitive items property.

AddComplexProperty ( System.Data.Services.Providers.ResourceType resourceType, string name, System.Data.Services.Providers.ResourceType complexType ) : void

Adds a complex property to the specified resourceType.

AddComplexType ( string name ) : System.Data.Services.Providers.ResourceType

Adds a new complex type (without any properties).

AddEntityType ( string name ) : System.Data.Services.Providers.ResourceType

Adds a new entity type (without any properties).

AddKeyProperty ( System.Data.Services.Providers.ResourceType resourceType, string name, Type propertyType ) : void

Adds a key property to the specified resourceType.

AddPrimitiveProperty ( System.Data.Services.Providers.ResourceType resourceType, string name, Type propertyType ) : void

Adds a primitive property to the specified resourceType.

AddResourceReferenceProperty ( System.Data.Services.Providers.ResourceType resourceType, string name, System.Data.Services.Providers.ResourceSet targetResourceSet ) : void

Adds a resource reference property to the specified resourceType.

This creates a property pointing to a single resource in the target resource set.

AddResourceSet ( string name, System.Data.Services.Providers.ResourceType entityType ) : System.Data.Services.Providers.ResourceSet

Adds a resource set to the metadata definition.

AddResourceSetReferenceProperty ( System.Data.Services.Providers.ResourceType resourceType, string name, System.Data.Services.Providers.ResourceSet targetResourceSet ) : void

Adds a resource set reference property to the specified resourceType.

This creates a property pointing to multiple resources in the target resource set.

Clone ( ) : object
DSPMetadata ( string containerName, string namespaceName ) : System

Creates new empty metadata definition.

GetDerivedTypes ( System.Data.Services.Providers.ResourceType resourceType ) : System.Collections.Generic.IEnumerable

Returns list of all types derived (directly or indirectly) from the specified resourceType.

Note that this method will get called even if the HasDerivedTypes returns false. The implementation should be reasonably fast as it can be called to process a query request. (Aside from being called for the $metadata processing).

GetResourceAssociationSet ( System.Data.Services.Providers.ResourceSet resourceSet, System.Data.Services.Providers.ResourceType resourceType, System.Data.Services.Providers.ResourceProperty resourceProperty ) : System.Data.Services.Providers.ResourceAssociationSet

Gets the ResourceAssociationSet instance when given the source association end.

This method returns a ResourceAssociationSet representing a reference which is specified by the resourceProperty on the resourceType for instances in the resourceSet.

HasDerivedTypes ( System.Data.Services.Providers.ResourceType resourceType ) : bool

Returns true if the specified type has some derived types.

The implementation should be fast as it will get called during normal request processing.

TryResolveResourceSet ( string name, System.Data.Services.Providers.ResourceSet &resourceSet ) : bool

Returnes a resource set specified by its name.

The implementation of this method should be very fast as it will get called for almost every request. It should also be fast for non-existing resource sets to avoid possible DoS attacks on the service.

TryResolveResourceType ( string name, System.Data.Services.Providers.ResourceType &resourceType ) : bool

Returnes a resource type specified by its name.

The implementation of this method should be very fast as it will get called for many requests. It should also be fast for non-existing resource types to avoid possible DoS attacks on the service.

TryResolveServiceOperation ( string name, System.Data.Services.Providers.ServiceOperation &serviceOperation ) : bool

Returns a service operation specified by its name.

The implementation of this method should be very fast as it will get called for many requests. It should also be fast for non-existing service operations to avoid possible DoS attacks on the service.

Приватные методы

Метод Описание
AddPrimitiveProperty ( System.Data.Services.Providers.ResourceType resourceType, string name, Type propertyType, bool isKey ) : void

Adds a key property to the specified resourceType.

AddReferenceProperty ( System.Data.Services.Providers.ResourceType resourceType, string name, System.Data.Services.Providers.ResourceSet targetResourceSet, bool resourceSetReference ) : void

Helper method to add a reference property.

SetReadOnly ( ) : void

Marks the metadata as read-only.

Описание методов

AddCollectionProperty() публичный Метод

Adds a collection of complex or primitive items property.
public AddCollectionProperty ( System.Data.Services.Providers.ResourceType resourceType, string name, System.Data.Services.Providers.ResourceType itemType ) : void
resourceType System.Data.Services.Providers.ResourceType The resource type to add the property to.
name string The name of the property to add.
itemType System.Data.Services.Providers.ResourceType The resource type of the item in the collection.
Результат void

AddCollectionProperty() публичный Метод

Adds a collection of primitive items property.
public AddCollectionProperty ( System.Data.Services.Providers.ResourceType resourceType, string name, Type itemType ) : void
resourceType System.Data.Services.Providers.ResourceType The resource type to add the property to.
name string The name of the property to add.
itemType System.Type The primitive CLR type of the item in the collection.
Результат void

AddComplexProperty() публичный Метод

Adds a complex property to the specified resourceType.
public AddComplexProperty ( System.Data.Services.Providers.ResourceType resourceType, string name, System.Data.Services.Providers.ResourceType complexType ) : void
resourceType System.Data.Services.Providers.ResourceType The resource type to add the property to.
name string The name of the property to add.
complexType System.Data.Services.Providers.ResourceType Complex type to use for the property.
Результат void

AddComplexType() публичный Метод

Adds a new complex type (without any properties).
public AddComplexType ( string name ) : System.Data.Services.Providers.ResourceType
name string The name of the type.
Результат System.Data.Services.Providers.ResourceType

AddEntityType() публичный Метод

Adds a new entity type (without any properties).
public AddEntityType ( string name ) : System.Data.Services.Providers.ResourceType
name string The name of the type.
Результат System.Data.Services.Providers.ResourceType

AddKeyProperty() публичный Метод

Adds a key property to the specified resourceType.
public AddKeyProperty ( System.Data.Services.Providers.ResourceType resourceType, string name, Type propertyType ) : void
resourceType System.Data.Services.Providers.ResourceType The resource type to add the property to.
name string The name of the property to add.
propertyType System.Type The CLR type of the property to add. This can be only a primitive type.
Результат void

AddPrimitiveProperty() публичный Метод

Adds a primitive property to the specified resourceType.
public AddPrimitiveProperty ( System.Data.Services.Providers.ResourceType resourceType, string name, Type propertyType ) : void
resourceType System.Data.Services.Providers.ResourceType The resource type to add the property to.
name string The name of the property to add.
propertyType System.Type The CLR type of the property to add. This can be only a primitive type.
Результат void

AddResourceReferenceProperty() публичный Метод

Adds a resource reference property to the specified resourceType.
This creates a property pointing to a single resource in the target resource set.
public AddResourceReferenceProperty ( System.Data.Services.Providers.ResourceType resourceType, string name, System.Data.Services.Providers.ResourceSet targetResourceSet ) : void
resourceType System.Data.Services.Providers.ResourceType The resource type to add the property to.
name string The name of the property to add.
targetResourceSet System.Data.Services.Providers.ResourceSet The resource set the resource reference property points to.
Результат void

AddResourceSet() публичный Метод

Adds a resource set to the metadata definition.
public AddResourceSet ( string name, System.Data.Services.Providers.ResourceType entityType ) : System.Data.Services.Providers.ResourceSet
name string The name of the resource set to add.
entityType System.Data.Services.Providers.ResourceType The type of entities in the resource set.
Результат System.Data.Services.Providers.ResourceSet

AddResourceSetReferenceProperty() публичный Метод

Adds a resource set reference property to the specified resourceType.
This creates a property pointing to multiple resources in the target resource set.
public AddResourceSetReferenceProperty ( System.Data.Services.Providers.ResourceType resourceType, string name, System.Data.Services.Providers.ResourceSet targetResourceSet ) : void
resourceType System.Data.Services.Providers.ResourceType The resource type to add the property to.
name string The name of the property to add.
targetResourceSet System.Data.Services.Providers.ResourceSet The resource set the resource reference property points to.
Результат void

Clone() публичный Метод

public Clone ( ) : object
Результат object

DSPMetadata() публичный Метод

Creates new empty metadata definition.
public DSPMetadata ( string containerName, string namespaceName ) : System
containerName string Name of the container to report.
namespaceName string Namespace name.
Результат System

GetDerivedTypes() публичный Метод

Returns list of all types derived (directly or indirectly) from the specified resourceType.
Note that this method will get called even if the HasDerivedTypes returns false. The implementation should be reasonably fast as it can be called to process a query request. (Aside from being called for the $metadata processing).
public GetDerivedTypes ( System.Data.Services.Providers.ResourceType resourceType ) : System.Collections.Generic.IEnumerable
resourceType System.Data.Services.Providers.ResourceType The resource type to determine derived types for.
Результат System.Collections.Generic.IEnumerable

GetResourceAssociationSet() публичный Метод

Gets the ResourceAssociationSet instance when given the source association end.
This method returns a ResourceAssociationSet representing a reference which is specified by the resourceProperty on the resourceType for instances in the resourceSet.
public GetResourceAssociationSet ( System.Data.Services.Providers.ResourceSet resourceSet, System.Data.Services.Providers.ResourceType resourceType, System.Data.Services.Providers.ResourceProperty resourceProperty ) : System.Data.Services.Providers.ResourceAssociationSet
resourceSet System.Data.Services.Providers.ResourceSet Resource set of the source association end.
resourceType System.Data.Services.Providers.ResourceType Resource type of the source association end.
resourceProperty System.Data.Services.Providers.ResourceProperty Resource property of the source association end.
Результат System.Data.Services.Providers.ResourceAssociationSet

HasDerivedTypes() публичный Метод

Returns true if the specified type has some derived types.
The implementation should be fast as it will get called during normal request processing.
public HasDerivedTypes ( System.Data.Services.Providers.ResourceType resourceType ) : bool
resourceType System.Data.Services.Providers.ResourceType The resource type to inspect.
Результат bool

TryResolveResourceSet() публичный Метод

Returnes a resource set specified by its name.
The implementation of this method should be very fast as it will get called for almost every request. It should also be fast for non-existing resource sets to avoid possible DoS attacks on the service.
public TryResolveResourceSet ( string name, System.Data.Services.Providers.ResourceSet &resourceSet ) : bool
name string The name of the resource set find.
resourceSet System.Data.Services.Providers.ResourceSet The resource set instance found.
Результат bool

TryResolveResourceType() публичный Метод

Returnes a resource type specified by its name.
The implementation of this method should be very fast as it will get called for many requests. It should also be fast for non-existing resource types to avoid possible DoS attacks on the service.
public TryResolveResourceType ( string name, System.Data.Services.Providers.ResourceType &resourceType ) : bool
name string The full name of the resource type (including its namespace).
resourceType System.Data.Services.Providers.ResourceType The resource type instance found.
Результат bool

TryResolveServiceOperation() публичный Метод

Returns a service operation specified by its name.
The implementation of this method should be very fast as it will get called for many requests. It should also be fast for non-existing service operations to avoid possible DoS attacks on the service.
public TryResolveServiceOperation ( string name, System.Data.Services.Providers.ServiceOperation &serviceOperation ) : bool
name string The name of the service operation to find.
serviceOperation System.Data.Services.Providers.ServiceOperation The service operation instance found.
Результат bool