Example #1
0
        public List <Models.Response.AnuncioRoupasResponse.Anuncio> ConversorAnuncioListaResponse(List <Models.TbAnuncio> req)
        {
            List <Models.Response.AnuncioRoupasResponse.Anuncio> resp = new List <Models.Response.AnuncioRoupasResponse.Anuncio>();

            foreach (Models.TbAnuncio anuncios in req)
            {
                Models.Response.AnuncioRoupasResponse.Anuncio x = this.ConversorAnuncioResponse(anuncios);
                resp.Add(x);
            }
            return(resp);
        }
        public List <Models.Response.AnuncioRoupasResponse.Anuncio> ConverterVariosFavoritosParaResponse(List <Models.TbFavorito> favoritos)
        {
            List <Models.Response.AnuncioRoupasResponse.Anuncio> resp = new List <Models.Response.AnuncioRoupasResponse.Anuncio>();

            foreach (Models.TbFavorito item in favoritos)
            {
                Models.Response.AnuncioRoupasResponse.Anuncio a = this.FavoritoParaResponse(item);
                resp.Add(a);
            }
            return(resp);
        }
 public Models.Response.AnuncioRoupasResponse.Anuncio FavoritoParaResponse(Models.TbFavorito favorito)
 {
     Models.Response.AnuncioRoupasResponse.Anuncio resp = new Models.Response.AnuncioRoupasResponse.Anuncio();
     resp.Titulo         = favorito.IdAnuncioNavigation.DsTitulo;
     resp.TipoProduto    = favorito.IdAnuncioNavigation.TpProduto;
     resp.Tamanho        = favorito.IdAnuncioNavigation.DsTamanho;
     resp.Preco          = favorito.IdAnuncioNavigation.VlPreco;
     resp.Marca          = favorito.IdAnuncioNavigation.NmMarca;
     resp.Condicao       = favorito.IdAnuncioNavigation.DsCondicao;
     resp.DataPublicacao = favorito.IdAnuncioNavigation.DtPublicacao;
     resp.Descricao      = favorito.IdAnuncioNavigation.DsDescricao;
     resp.Genero         = favorito.IdAnuncioNavigation.DsGenero;
     resp.IdAnuncio      = favorito.IdAnuncioNavigation.IdAnuncio;
     resp.Imagens        = favorito.IdAnuncioNavigation.TbImagem.Select(x => new Models.Response.AnuncioRoupasResponse.Imagem()
     {
         IdDoAnuncio = x.IdAnuncio,
         IdImagem    = x.IdImagem,
         TextoImagem = x.ImgAnuncio
     }).ToList();
     return(resp);
 }
Example #4
0
        public Models.Response.AnuncioRoupasResponse.Anuncio ConversorAnuncioResponse(Models.TbAnuncio anuncio)
        {
            Models.Response.AnuncioRoupasResponse.Anuncio resp = new Models.Response.AnuncioRoupasResponse.Anuncio();
            resp.IdAnuncio      = anuncio.IdAnuncio;
            resp.Titulo         = anuncio.DsTitulo;
            resp.Descricao      = anuncio.DsDescricao;
            resp.TipoProduto    = anuncio.TpProduto;
            resp.Condicao       = anuncio.DsCondicao;
            resp.Genero         = anuncio.DsGenero;
            resp.Marca          = anuncio.NmMarca;
            resp.Tamanho        = anuncio.DsTamanho;
            resp.Preco          = anuncio.VlPreco;
            resp.DataPublicacao = anuncio.DtPublicacao;

            resp.Imagens = anuncio.TbImagem.Select(x => new Models.Response.AnuncioRoupasResponse.Imagem()
            {
                IdImagem    = x.IdImagem,
                IdDoAnuncio = x.IdAnuncio,
                TextoImagem = x.ImgAnuncio
            }).ToList();

            return(resp);
        }