public IActionResult Detalhes(int id) { CookiesRepository cookiesRepository = new CookiesRepository(); Cookie cookie = cookiesRepository.FindById(id); return(View("Detalhes", cookie)); }
public void CookiesPedido() { PedidoRepository pedidoRepository = new PedidoRepository(); CookiesRepository cookiesRepository = new CookiesRepository(); Cookie cookie = cookiesRepository.FindById(2); Assert.Equal("Cookies de Morango", cookie.nome); }
public IActionResult FazerPedido(int id, int user) { PedidoRepository pedidoRepository = new PedidoRepository(); CookiesRepository cookiesRepository = new CookiesRepository(); Cookie cookie = cookiesRepository.FindById(id); pedidoRepository.FazerPedido(cookie.id, user); return(RedirectToAction("Index", "Home")); }