WCF rename ArrayOf -


i have created wcf using ioc container below:

public class regionwebservice : iregion {     private readonly iregionservice _regionservice;     private readonly imapper _mapper;      public regionwebservice(iregionservice regionservice, imapper mapper)     {         _regionservice = regionservice;         _mapper = mapper;     }      public ienumerable<wsregiondto> getregions()     {         var regions = _regionservice.getallasync().result;         return _mapper.map<ienumerable<regiondto>, ienumerable<wsregiondto>>(regions);     } } 

wsregiondto class:

[datacontract(name = "region")] public class wsregiondto {     [datamember(name = "name")]     public string name { get; set; } } 

wcf returns:

<arrayofregion>     <region>         <name>aspac</name>     </region>     <region>         <name>emea</name>     </region>     <region>         <name>latam</name>     </region>     <region>         <name>mexico</name>     </region>     <region>         <name>n/a</name>     </region>     <region>         <name>nam</name>     </region> </arrayofregion> 

i have created wsregiondto class wcf purposes because don't know impact adding datacontract have in case use regiondto in other places (different wcf). rename arrayofregion withregions. how can achieve that? tried in google no luck.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -