A Sandcastle Documented Class Library

# CredentialContext Execute T Method (Func T )

Executes the provided delegate under the context of the credentials.

Namespace: Dundas.BI.Data.DataRetrieval
Assembly: Dundas.BI.Core (in Dundas.BI.Core.dll) Version: 2.0.0.0 (10.0.0.1002)
Syntax
C#
VB
C++
F#
Copy

    public virtual T Execute<T>(
    	Func<T> func
    )

    Public Overridable Function Execute(Of T) (
    	func As Func(Of T)
    ) As T

    public:
    generic<typename T>
    virtual T Execute(
    	Func<T>^ func
    )

    abstract Execute :
            func : Func<'T> -> 'T
    override Execute :
            func : Func<'T> -> 'T

#### Parameters

func
  Type: System
  Func
  T
  The Func
  T, TResult
  to run.

#### Type Parameters

T

#### Return Value

Type: T
Exceptions

Exception | Condition
--- | ---
ArgumentNullException | func is .

Remarks
If IsContextLinkedToCurrentThread is
for the corresponding credential provider, any code which needs to be run under the context of the credentials must be done so using this method or one of its overloads.
See Also

#### Reference

CredentialContext Class
Execute Overload
Dundas.BI.Data.DataRetrieval Namespace
DataSourceCredentialProvider
IsDelegateExecutionRequired