Partager via


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

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, _
    databaseCategory As String _
) As TInterface
public static TInterface CreateComponent<TInterface, TComponent>(
    this TeamFoundationRequestContext context,
    string databaseCategory
)
where TComponent : new(), TeamFoundationSqlResourceComponent, TInterface
[ExtensionAttribute]
public:
generic<typename TInterface, typename TComponent>
where TComponent : gcnew(), TeamFoundationSqlResourceComponent, TInterface
static TInterface CreateComponent(
    TeamFoundationRequestContext^ context, 
    String^ databaseCategory
)
static member CreateComponent : 
        context:TeamFoundationRequestContext * 
        databaseCategory:string -> '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