ContractDescription.GetContract Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Vrátí popis kontraktu pro zadaný typ kontraktu.
Přetížení
GetContract(Type, Type) |
Vrátí popis kontraktu pro zadaný typ kontraktu a zadaný typ služby. |
GetContract(Type, Object) |
Vrátí popis kontraktu pro zadaný typ implementace kontraktu a služby. |
GetContract(Type) |
Vrátí popis kontraktu pro zadaný typ kontraktu. |
Poznámky
Rozdíl mezi GetContract přetíženími spočívá v tom, že ty se dvěma argumenty umožňují najít atributy ze služby (například OperationBehaviorAttribute).
GetContract(Type, Type)
Vrátí popis kontraktu pro zadaný typ kontraktu a zadaný typ služby.
public:
static System::ServiceModel::Description::ContractDescription ^ GetContract(Type ^ contractType, Type ^ serviceType);
public static System.ServiceModel.Description.ContractDescription GetContract (Type contractType, Type serviceType);
static member GetContract : Type * Type -> System.ServiceModel.Description.ContractDescription
Public Shared Function GetContract (contractType As Type, serviceType As Type) As ContractDescription
Parametry
Návraty
Zadaný ContractDescription typ kontraktu a typu služby.
Příklady
ContractDescription cd4 = ContractDescription.GetContract(typeof(ICalculator), typeof(CalculatorService));
Dim cd4 As ContractDescription = ContractDescription.GetContract(GetType(ICalculator), GetType(CalculatorService))
Poznámky
Rozdíl mezi GetContract přetíženími spočívá v tom, že ty se dvěma argumenty umožňují najít atributy ze služby (například OperationBehaviorAttribute).
Platí pro
GetContract(Type, Object)
Vrátí popis kontraktu pro zadaný typ implementace kontraktu a služby.
public:
static System::ServiceModel::Description::ContractDescription ^ GetContract(Type ^ contractType, System::Object ^ serviceImplementation);
public static System.ServiceModel.Description.ContractDescription GetContract (Type contractType, object serviceImplementation);
static member GetContract : Type * obj -> System.ServiceModel.Description.ContractDescription
Public Shared Function GetContract (contractType As Type, serviceImplementation As Object) As ContractDescription
Parametry
Návraty
Zadaný ContractDescription typ implementace kontraktu a služby.
Příklady
CalculatorService calcSvc = new CalculatorService();
ContractDescription cd3 = ContractDescription.GetContract(typeof(ICalculator), calcSvc);
Dim calcSvc As New CalculatorService()
Dim cd3 As ContractDescription = ContractDescription.GetContract(GetType(ICalculator), calcSvc)
Poznámky
Rozdíl mezi GetContract přetíženími spočívá v tom, že ty se dvěma argumenty umožňují najít atributy ze služby (například OperationBehaviorAttribute).
Platí pro
GetContract(Type)
Vrátí popis kontraktu pro zadaný typ kontraktu.
public:
static System::ServiceModel::Description::ContractDescription ^ GetContract(Type ^ contractType);
public static System.ServiceModel.Description.ContractDescription GetContract (Type contractType);
static member GetContract : Type -> System.ServiceModel.Description.ContractDescription
Public Shared Function GetContract (contractType As Type) As ContractDescription
Parametry
Návraty
Pro ContractDescription zadaný typ kontraktu.
Příklady
ContractDescription cd2 = ContractDescription.GetContract(typeof(ICalculator));
Dim cd2 As ContractDescription = ContractDescription.GetContract(GetType(ICalculator))
Poznámky
Rozdíl mezi GetContract přetíženími spočívá v tom, že ty se dvěma argumenty umožňují najít atributy ze služby (například OperationBehaviorAttribute).