I am wondering if I am missing anything here... My understanding is that I should be able to get the ID property (but not set it) after deserializing. As it stands, the ID property is not brought along at all:
namespace CableSolve.Orders.Core.Dto
{
[Serializable]
[XmlRoot("Task"), SoapType("Task")]
public class TaskDto : IDto
{
// ReSharper disable ConvertToAutoPropertyWithPrivateSetter
private int _id;
public int ID { get { return _id; } }
// ReSharper restore ConvertToAutoPropertyWithPrivateSetter
public int TaskSequence { get; set; }
public TaskDto()
{
}
}
}
Ideally my ID would not be settable. If I give the ID property an automatic, private setter -- XML Serializer throws a fit. I thought the workaround for that was described here, but it does not appear to work for non-collections? I would prefer to not have to rewrite using DataContract at this point in time.
'CableSolve.Web.Api.WorkflowServicesProxy.TaskDto' does not contain a definition for 'ID' and no extension method 'ID' accepting a first argument of type 'CableSolve.Web.Api.WorkflowServicesProxy.TaskDto' could be found