public IActionResult Add(ProgramInputModel input) { if (!ModelState.IsValid) { return(View(input)); } var program = _mapper.Map <Models.Program>(input); _programService.AddProgram(program); _programService.SaveChanges(); _logger.LogInformation("{user} added program {program}", User.Identity.Name, program.ShortName); return(RedirectToAction("Index")); }
public IActionResult AddProgram(Creator creator, string type, int id) { programService.AddProgram(type, creator, id); return(RedirectToAction("Index")); }