xml - WCF Array Serialization - REST -


i have rest web service returns structure containing array of more structures. return structure looks this:

[datacontract] public class response {   private responserecord[] m_record;    [datamember]   public int totalrecords { get; set; }    [datamember]   public responserecord[] record {     { return m_record; }     set { m_record = value; }   } } 

the responserecord class this:

[datacontract(name="record")] public class responserecord {   [datamember(order = 0)]   public string recordid { get; set; } /* many more objects */ } 

my web service returns xml this:

<response>   <totalrecords>1</totalrecords>   <record>     <responserecord>       <recordid>1</recordid>       ... many more objects ...     </responserecord>   </record> </response> 

what rid of "responserecord" hierarchal level, adds no new information. web service runs soap , xml, , (name="record") attribute did trick. not rest reason, though. why?

first of all, suggest change record property records records is.

also, if remove responserecord, there won't group properties of each responserecord instance together. not possible.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -