Click or drag to resize

OperationServiceExtensionsCallExternalOperationTRequest, TResponse Method

Calls an operation which is implemented in another plugin.

Namespace:  Resto.Front.Api.Extensions
Assembly:  Resto.Front.Api.V6 (in Resto.Front.Api.V6.dll)
Syntax
C#
public static TResponse CallExternalOperation<TRequest, TResponse>(
	this IOperationService operationService,
	string serviceName,
	string operationName,
	TRequest request,
	SerializationBinder binder = null,
	ISurrogateSelector surrogateSelector = null
)

Parameters

operationService
Type: Resto.Front.ApiIOperationService
Operation service.
serviceName
Type: SystemString
Name of the external service which is implemented in another plugin. That name have to be pre-shared with consumer plugins.
operationName
Type: SystemString
Name of the external operation which is implemented in another plugin and have been registered using RegisterExternalOperationTRequest, TResponse(IOperationService, String, String, FuncTRequest, TResponse, SerializationBinder, ISurrogateSelector). That name have to be pre-shared between producer and consumer plugins.
request
Type: TRequest
The data which will be transferred as an incoming argument into the external operation.
binder (Optional)
Type: System.Runtime.SerializationSerializationBinder
A serialization binder for custom mapping between types and names. Default is null.
surrogateSelector (Optional)
Type: System.Runtime.SerializationISurrogateSelector
The ISurrogateSelector to use for serialization. Default is null.

Type Parameters

TRequest
TResponse

Return Value

Type: TResponse
Response returned by the producer plugin.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IOperationService. 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).
Exceptions
ExceptionCondition
ExternalOperationFailedExceptionWhen an external operation throws any kind of exception, caller receives the ExternalOperationFailedException with original message. Orignal stacktrace can be found in api.log.
Remarks
Different plugins running under the same iikoFront application instance can communicate via external operations. iikoFront just transfers requests and responses between plugins without knowing any details. Both producer and consumer plugins should understand the data structure, developers should negotiate a protocol specification, pre-share operation names, handle versioning and so on. Producer plugin registers an operation using RegisterExternalOperationTRequest, TResponse(IOperationService, String, String, FuncTRequest, TResponse, SerializationBinder, ISurrogateSelector) and consumer plugin call it using CallExternalOperationTRequest, TResponse(IOperationService, String, String, TRequest, SerializationBinder, ISurrogateSelector).
See Also