Example #1
0
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(RedirectToAction(nameof(Error), new { message = "Venda Inválida!" }));
            }

            var venda = await _vendaServico.FindFirstAsync(x => x.ID == id, "Livro", "Cliente");

            if (venda == null)
            {
                return(RedirectToAction(nameof(Error), new { message = "Venda não encontrada!" }));
            }

            return(View(venda));
        }