Exemple #1
0
        public async Task <ActionResult> Edit([Bind(Include = "Id, Name")] Programme programme)
        {
            if (ModelState.IsValid)
            {
                Programme programmeToBeUpdated = _programmeRepository.GetById(programme.Id);
                programmeToBeUpdated.Name = programme.Name;

                _programmeRepository.GetEntry(programmeToBeUpdated).State = EntityState.Modified;
                await _programmeRepository.Commit();

                RedirectToAction("Details", new { id = programme.Id });
            }

            return(View(programme));
        }