[WebGet] public IQueryable<VolumeEntry> GetTradeVolumes(int tranNum)
[DataServiceKey("StartTimeUtc")] public class VolumeEntry { public DateTime StartTimeUtc { get; set; } public DateTime EndTimeUtc { get; set; } public int VolumeType { get; set; } public double Quantity { get; set; } }
The server was sending the data in the correct form however the client was returning the wrong results. It returned the correct number of results but the VolumeType and Quantity fields were wrong - they always contained the same values.
The problem was that the custom type was actually keyed on StartTimeUtc AND VolumeType, not just StartTimeUtc as was marked with the DataServiceKey attribute.
Once modified the client returned the right results.
[DataServiceKey("StartTimeUtc", "VolumeType")] public class VolumeEntry { public DateTime StartTimeUtc { get; set; } public DateTime EndTimeUtc { get; set; } public int VolumeType { get; set; } public double Quantity { get; set; } }
No comments:
Post a Comment