Exemple #1
0
 public IActionResult Create([Bind] RehearsalDetailEditViewModel model)
 {
     if (ModelState.IsValid)
     {
         var rehearsal = model.ToRehearsal();
         _rehearsalMapper.Create(rehearsal);
         return(RedirectToAction(nameof(Admin)));
     }
     return(View(model));
 }
Exemple #2
0
        public IActionResult Edit(int id, [Bind] RehearsalDetailEditViewModel model)
        {
            if (id != model.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                var rehearsal = model.ToRehearsal();
                _rehearsalMapper.Update(rehearsal);
                return(RedirectToAction(nameof(Admin)));
            }
            return(View(model));
        }