Поделиться через


RequestContextExtensions.CreateComponent<TInterface, TComponent> Method (TeamFoundationRequestContext)

Creates a component that can be used to communicate to the current version of the database. Construct via an interface so that it is more trivially mock/stubbable using Fakes.

Namespace:  Microsoft.TeamFoundation.Framework.Server
Assembly:  Microsoft.TeamFoundation.Framework.Server (in Microsoft.TeamFoundation.Framework.Server.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function CreateComponent(Of TInterface, TComponent As {New, TeamFoundationSqlResourceComponent, TInterface}) ( _
    context As TeamFoundationRequestContext _
) As TInterface
public static TInterface CreateComponent<TInterface, TComponent>(
    this TeamFoundationRequestContext context
)
where TComponent : new(), TeamFoundationSqlResourceComponent, TInterface
[ExtensionAttribute]
public:
generic<typename TInterface, typename TComponent>
where TComponent : gcnew(), TeamFoundationSqlResourceComponent, TInterface
static TInterface CreateComponent(
    TeamFoundationRequestContext^ context
)
static member CreateComponent : 
        context:TeamFoundationRequestContext -> 'TInterface  when 'TComponent : new() and TeamFoundationSqlResourceComponent and 'TInterface
JScript does not support generic types or methods.

Type Parameters

  • TInterface
    A mockable interface implemented by the component
  • TComponent
    The type of component to create.

Parameters

Return Value

Type: TInterface

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type TeamFoundationRequestContext. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

.NET Framework Security

See Also

Reference

RequestContextExtensions Class

CreateComponent Overload

Microsoft.TeamFoundation.Framework.Server Namespace