Ejemplo n.º 1
0
        public async Task <HttpResponseMessage> GetVMAP(int id)
        {
            SimpleAdModel ad = await service.GetAdByIdAsync(id);

            Outbound.ContractTypes.VMAP vmap = VMAPConverter.GetVMAP(ad);
            return(Request.CreateResponse(HttpStatusCode.OK, ToXML(vmap)));
        }
Ejemplo n.º 2
0
        public string ToXML(Outbound.ContractTypes.VMAP vmap)
        {
            var stringwriter = new System.IO.StringWriter();
            var serializer   = new XmlSerializer(vmap.GetType());

            serializer.Serialize(stringwriter, vmap);
            return(stringwriter.ToString());
        }