Example #1
0
        public static async Task <Uri> agregarCarta(Carta2 c)
        {
            var url = "http://localhost:8034/api/carta/" + c.imagenCarta + "/" + c.nombreCarta + "/" + c.valorCarta + "/" + c.idCategoria + "/agregarCarta";
            HttpResponseMessage response = await client.PostAsJsonAsync(url, c);

            return(response.Headers.Location);
        }
Example #2
0
        public async Task <ActionResult> Agregar(Carta2 c)
        {
            //ViewBag.Result1 = categoriaApiClienat.categorias();

            c.imagenCarta = "url";
            var result = await agregarCarta(c);

            List <Carta2> model = cartaApiController.listarCartas();

            ViewBag.data = model;

            return(View("Listar", new Carta()));
        }