public async Task <ActionResult <ProductoPostMV> > Index() { var productos = _context.Productos.Include(x => x.Imagen) .Include(x => x.Categoria).ToListAsync(); var posts = _context.Posts.Include(x => x.Imagenes).ToListAsync(); var prodPostMv = new ProductoPostMV { Productos = await productos, Posts = await posts }; return(View(prodPostMv)); }
public async Task <ActionResult <ProductoPostMV> > Posts() { var posts = _context.Posts.Include(x => x.Calificaciones). Include(y => y.Imagenes).Include(z => z.Comentarios).ToListAsync(); var productos = _context.Productos.Include(x => x.Imagen) .ToListAsync(); var result = new ProductoPostMV { Posts = await posts, Productos = await productos }; ViewData["Aside"] = result; return(View(result)); }
public async Task <IActionResult> MapSite() { var posts = _context.Posts.Include(x => x.Calificaciones). Include(y => y.Imagenes).Include(z => z.Comentarios).ToListAsync(); var productos = _context.Productos. Include(x => x.Imagen).ToListAsync(); var share = new ProductoPostMV { Posts = await posts, Productos = await productos }; ViewData["Aside"] = share; return(View()); }
public async Task <ActionResult <Producto> > Dogs() { var dogProducts = _context.Productos.Include(x => x.Imagen) .Where(x => x.TipoMascota == "perro").ToListAsync(); var posts = _context.Posts.Include(x => x.Calificaciones). Include(y => y.Imagenes).Include(z => z.Comentarios).ToListAsync(); var productos = _context.Productos. Include(x => x.Imagen).ToListAsync(); var share = new ProductoPostMV { Posts = await posts, Productos = await productos }; ViewData["Aside"] = share; return(View(await dogProducts)); }
public async Task <ActionResult <PostProductoMV> > Post(long id) { var post = _context.Posts.FindAsync(id); var productosxpost = _context.Productoxposts.Where(x => x.Post.Id.Equals(id)).ToListAsync(); var posts = _context.Posts.Include(x => x.Calificaciones). Include(y => y.Imagenes).Include(z => z.Comentarios).ToListAsync(); var productos = _context.Productos. Include(x => x.Imagen).ToListAsync(); var share = new ProductoPostMV { Posts = await posts, Productos = await productos }; var result = new PostProductoMV { Post = await post, Productoxposts = await productosxpost }; ViewData["Aside"] = share; return(View(result)); }