DurableOperationAttribute.CanCreateInstance 属性

定义

获取或设置一个值,该值指示如果在此操作中接收到激活消息,是否创建一个新服务实例。Gets or sets a value that indicates whether a new service instance can be created if an activation message is received on this operation. 调度程序会将无附加实例 ID 的消息视为激活消息。The dispatcher considers messages without an attached instance ID to be activation messages.

public:
 property bool CanCreateInstance { bool get(); void set(bool value); };
public bool CanCreateInstance { get; set; }
member this.CanCreateInstance : bool with get, set
Public Property CanCreateInstance As Boolean

属性值

Boolean

如果可以创建新服务实例,则为 true;否则为 falsetrue if a new service instance can be created; otherwise, false.

注解

如果协定不允许会话,则必须将所有操作的 CanCreateInstance 设置为 trueIf your contract disallows sessions, then CanCreateInstance must be set to true for all operations.

如果协定允许会话,则 CanCreateInstance 设置为 true 的所有操作必须为请求/响应操作:即 IsOneWay 不能设置为 trueIf the contract permits or allows sessions, then all operations for which CanCreateInstance is set to true must be request/response operations: that is, IsOneWay cannot be set to true.

适用于