English 中文(简体)
履历
原标题:nservicebus message serialization

我愿使用基文信息类,如:

[Serializable]
public abstract class MessageBase : IMessage
{
    public Guid MessageID { get; private set; }
    public DateTime UtcDateTime { get; private set; }

    protected MessageBase()
    {
        UtcDateTime = DateTime.UtcNow;
        MessageID = Guid.NewGuid();
    }

    public override string ToString()
    {
        return string.Format("{0} MessageID={1}, UtcDate={2}", GetType().FullName, MessageID, UtcDateTime);
    }
}

新的信息将通过从这一基类分类生成。 我注意到了这一问题。 当我发布电文时,我发现,电文和电文处理时间不同。

我失踪了什么?

最佳回答

我知道,你想向私人建筑商宣布电离层和天线,以便倒线的人能够改变电线,但是,在这样做的时候,如果电文在接收器上重建,你阻止序列器重新应用这些价值。

正在发生的情况是,序列化器在你的信息类型上发现了一个新的例子,而你的两种特性都是在UtcNow和NewGuid(新指南)的开端,然后从电文中被压倒。 因此,它们似乎有所不同。

如果你从财产申报中删除私人关键词,你就应当得到你期望的行为。

然而,你至少(假定你向你的手里注入了一台IBus)不去打上你自己的跟踪机制,而只看Bus.CurrentMessageContext,其中载有一个“Id”财产,用于所处理的信息(显示,而不是准则)和一张头盔。 I m 不是100%的,但如果你检查头盔,可能有一些迹象显示那里最初的派任时间。

问题回答

暂无回答




相关问题
Choosing the right subclass to instantiate programmatically

Ok, the context is some serialization / deserialization code that will parse a byte stream into an object representation that s easier to work with (and vice-versa). Here s a simplified example ...

WCF Problem Sending Object To Client

Background Converting from using .Net Remoting to WCF. Most of the methods on the WCF server are working fine, but ran into one that isn t working today. This is the service contract: [...

WCF DataMember Serializing questions

Ok, so I was part way through the long winded process of creating DTOs for sending my model over the wire and I don t feel like I m going down the right route. My issue is that most of the entities ...

deserialize the XML Document --- Need Help

I am using the below code snippet now to deserialize the XML document ... [WebMethod] public XmlDocument OrderDocument(XmlDocument xmlDoc) { XmlSerializer serializer = new XmlSerializer(typeof(...

How do I serialize a child class?

how do I include the serialized data from a child class where both impliment iserializeable? Class A Implements ISerializable dim _B as new B Class B Implements ISerializable ...

WCF: Serialize complex objects with read-only members

Looking for some guidance on a WCF service I’m prototyping. I have a WCF service hosted in IIS that will pass data to my clients. I have a separate shared assembly that contains all my business ...

Long/multiple SQL queries vs Serialization

I m trying to improve the performance of my web app where a page does a long query to pull data from different tables on a database. It pulls invoice data with multiple item lines, invoice status, and ...

热门标签