Ejemplo n.º 1
0
        public void UpdateSpeaker(Guid speakerId, SpeakerEditModel model)
        {
            var speaker = GetSpeaker(speakerId);

            model.MapTo(speaker);
            _repository.SaveChanges();
        }
Ejemplo n.º 2
0
 public ActionResult EditCommand(Guid id, SpeakerEditModel model)
 {
     if (ModelState.IsValid)
     {
         _speakerService.UpdateSpeaker(id, model);
         return(RedirectToAction("Details", new { id }));
     }
     return(View(model));
 }
Ejemplo n.º 3
0
 public static IHtmlString EditSpeaker(this HtmlHelper htmlHelper, string caption, SpeakerEditModel speaker)
 {
     return(htmlHelper.ActionLink(caption, "Edit", "Speaker", new {
         id = speaker.Id
     }, null));
 }