I hope this is not an idiot question… my brain is so full of new stuff it hurts.
I’m attempting to get to know NServiceBus a little better.
My message classes look like this:
public class Address // value object
{
public readonly string AddressLine1;
public readonly string AddressLine2;
public readonly string AddressLine3;
public readonly string City;
public readonly string Country;
public readonly string PostCode;
public Address(string addressLine1,
string addressLine2,
string addressLine3,
string city,
string country,
string postCode)
{
AddressLine1 = addressLine1;
AddressLine2 = addressLine2;
AddressLine3 = addressLine3;
City = city;
Country = country;
PostCode = postCode;
}
}
Problem is NServiceBus serializer cannot deal with it (understandably so) and i end up having to revert to auto properties. I can live with it for this learning exercise… but is there a way to use the message class above?
I thought I would ask instead of delving into NServiceBus source code. Thanks!
I’m pretty sure it’ll work if you expose get/private set properties rather than fields.