SystemTarget.GetOrSetExtension<TExtension,TExtensionInterface> 方法

定义

将扩展绑定到可寻址对象(如果尚未完成)。

public (TExtension, TExtensionInterface) GetOrSetExtension<TExtension,TExtensionInterface> (Func<TExtension> newExtensionFunc) where TExtension : class, TExtensionInterface where TExtensionInterface : class, Orleans.Runtime.IGrainExtension;
abstract member GetOrSetExtension : Func<#'ExtensionInterface> -> ValueTuple<#'ExtensionInterface, 'ExtensionInterface (requires 'ExtensionInterface : null and 'ExtensionInterface :> Orleans.Runtime.IGrainExtension)> (requires 'ExtensionInterface : null and 'ExtensionInterface :> Orleans.Runtime.IGrainExtension)
override this.GetOrSetExtension : Func<#'ExtensionInterface> -> ValueTuple<#'ExtensionInterface, 'ExtensionInterface (requires 'ExtensionInterface : null and 'ExtensionInterface :> Orleans.Runtime.IGrainExtension)> (requires 'ExtensionInterface : null and 'ExtensionInterface :> Orleans.Runtime.IGrainExtension)
Public Function GetOrSetExtension(Of TExtension As {Class, TExtensionInterface}, TExtensionInterface As {Class, TExtensionInterface}) (newExtensionFunc As Func(Of TExtension)) As ValueTuple(Of TExtension, TExtensionInterface)

类型参数

TExtension

扩展的类型 (例如 StreamConsumerExtension) 。

TExtensionInterface

实现的公共接口类型。

参数

newExtensionFunc
Func<TExtension>

一个工厂函数,用于构造新的扩展对象。

返回

ValueTuple<TExtension,TExtensionInterface>

元组,首先包含扩展,第二个元组包含对扩展接口的可寻址引用。

实现

适用于