public async Task EncerrarEmprestimo(int id) { var emprestimo = await _dbContext.Emprestimos.SingleOrDefaultAsync(x => x.Id == id); await _livroRepository.AlugarDevolverLivro(emprestimo.LivroId); await Delete(id); }