WF 4 中继承的 DataMember 属性上基于内容的关联
在.NET 4.0下的Windows Workflow Foundation中,是否有一种方法可以根据继承的数据成员关联操作? 例如,给定以下类,
[DataContract]
[KnownType(typeof(DerivedMessage))]
public abstract class BaseMessage
{
[DataMember(Order = 1)]
public Guid MessageId { get; set; }
}
[DataContract]
public class DerivedMessage : BaseMessage
{
[DataMember(Order = 1)]
public string AdditionalProperty { get; set; }
}
是否可以在接受 DerivedMessage
实例的操作上使用属性 MessageId
进行关联?
当尝试在 VS2010 中的 Receive 活动的 CorrelatesOn Definition 对话框中使用此类属性时,会引发以下错误:
生成 XPath 查询时找不到成员的路径。
我在这里做错了什么吗?该错误消息不是很有帮助,因为我看不出为什么它不能生成对 DerivedMessage 上的 MessageId 属性的 XPath 查询。
In Windows Workflow Foundation under .NET 4.0, is there a way to correlate operations based on an inherited data member?
For example given the following classes
[DataContract]
[KnownType(typeof(DerivedMessage))]
public abstract class BaseMessage
{
[DataMember(Order = 1)]
public Guid MessageId { get; set; }
}
[DataContract]
public class DerivedMessage : BaseMessage
{
[DataMember(Order = 1)]
public string AdditionalProperty { get; set; }
}
Shouldn't it be possible to correlate using the property MessageId
on an operation accepting an instance of DerivedMessage
?
When attempting to use such a property in the CorrelatesOn Definition dialog of a Receive activity in VS2010 the following error is thrown:
Cannot find a path to the member when generating the XPath query.
Am I doing something wrong here? The error message isn't very helpful as I see no reason why it shouldn't be able to generate an XPath query to the MessageId property on the DerivedMessage.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
UI 只是为您生成相关 XPath 查询的助手。您随时都可以直接输入。
The UI is just a helper to generate the relevant XPath query for you. You can always just type it in.