Table of Contents

Class ODataDataProvider

Namespace
combit.Reporting.DataProviders
Assembly
combit.ListLabel31.CrossPlatform.dll

Provides an OData data provider implementation for querying OData endpoints.

public sealed class ODataDataProvider : IDataProvider, ICanHandleUsedIdentifiers, IDisposable, ISupportsLogger
Inheritance
ODataDataProvider
Implements
Inherited Members

Remarks

The ODataDataProvider class implements IDataProvider, ICanHandleUsedIdentifiers, IDisposable, combit.Reporting.DataProviders.ISupportsParameters and ISupportsLogger to support querying, managing used identifiers, logging, and resource disposal. Use this class to integrate OData sources with your application.

Constructors

ODataDataProvider(string, bool)

Initializes a new instance of the ODataDataProvider class with the specified URL and a flag indicating whether to retrieve real values for the designer.

public ODataDataProvider(string url, bool retrieveRealValuesForDesigner)

Parameters

url string

The URL of the OData service.

retrieveRealValuesForDesigner bool

If set to true, real values will be retrieved for the designer.

ODataDataProvider(string, bool, ICredentials)

Initializes a new instance of the ODataDataProvider class with the specified URL, a flag indicating whether to retrieve real values for the designer, and network credentials.

public ODataDataProvider(string url, bool retrieveRealValuesForDesigner, ICredentials networkCredential)

Parameters

url string

The URL of the OData service.

retrieveRealValuesForDesigner bool

If set to true, real values will be retrieved for the designer.

networkCredential ICredentials

The network credentials used for authentication.

ODataDataProvider(string, bool, ICredentials, string)

Initializes a new instance of the ODataDataProvider class with the specified URL, a flag indicating whether to retrieve real values for the designer, network credentials, and a local metadata file path.

public ODataDataProvider(string url, bool retrieveRealValuesForDesigner, ICredentials networkCredential, string localMetadataFilePath)

Parameters

url string

The URL of the OData service.

retrieveRealValuesForDesigner bool

If set to true, real values will be retrieved for the designer.

networkCredential ICredentials

The network credentials used for authentication.

localMetadataFilePath string

The file path to a local metadata file.

Properties

ConnectionTimeout

Gets or sets the connection timeout (in seconds) for OData requests.

public int ConnectionTimeout { get; set; }

Property Value

int

Headers

Gets the collection of HTTP headers that should be used for the request.

public HttpRequestHeaders Headers { get; }

Property Value

HttpRequestHeaders

LegacyMode

Gets or sets a value indicating whether legacy mode is enabled. This property exists for backward compatibility with existing reports.

[Obsolete("Just for backward compatibility with existing reports.")]
public bool LegacyMode { get; set; }

Property Value

bool

MaximumEmbeddedFieldDepth

Gets or sets the maximum depth for embedded fields.

public int MaximumEmbeddedFieldDepth { get; set; }

Property Value

int

NetworkCredential

Gets the network credentials used for authentication.

public ICredentials NetworkCredential { get; }

Property Value

ICredentials

Url

Gets the OData service URL.

public string Url { get; }

Property Value

string

Methods

AddAdditionalParameter(string, string?)

Adds an additional url parameter to the OData query for the given tableName. If tableName is null the parameter will be added to all tables.

public void AddAdditionalParameter(string parameter, string? tableName = null)

Parameters

parameter string

The parameter that should be added to the url for the given tableName e.g. Company={{Company=combit|choices=combit,Contoso}}

tableName string

The name of the table where the parameter should be added in the request. If null the parameter will be added to all tables.

Examples

provider.AddAdditionalParameter("Company={{Company=combit|choices=combit,Contoso}}"); //All tables provider.AddAdditionalParameter("CustomerPrefix={{CustomerPrefix=AB|choices=AB,CD}}", "Customers"); //Specific table (will also have parameters specified for all tables)

Exceptions

InvalidOperationException

Thrown if the metadata is already loaded (Parameters can only be defined before the initialization took place).

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

~ODataDataProvider()

protected ~ODataDataProvider()

Events

DefineTable

Occurs before adding a new table or its relations. This event allows the caller to suppress the addition of the table.

public event EventHandler<DefineTableEventArgs> DefineTable

Event Type

EventHandler<DefineTableEventArgs>