Beispiel #1
0
        // GET: Disciplina/Details/5
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var disciplina = await _disciplinaRepository.ObterAsync(id.Value);

            if (disciplina == null)
            {
                return(NotFound());
            }

            return(View(disciplina));
        }
Beispiel #2
0
        public async Task <int> AlterarDisciplinaAsync(int id, string nome)
        {
            var disciplna = await _disciplinaRepository.ObterAsync(id);

            disciplna.Nome         = nome;
            disciplna.AtualizadoEm = DateTime.Now;
            _disciplinaRepository.Modificar(disciplna);
            return(await _disciplinaRepository.SaveChangesAsync());
        }