public ActionResult AddEntry(int id) { var viewModel = new EntryViewModel { BlogId = id }; return View(viewModel); }
public ActionResult EditEntry(EntryViewModel viewModel, int blogId) { EntryDto entryDto = new EntryDto { EntryId = viewModel.EntryId, Body = viewModel.Body, Title = viewModel.Title, }; _service.EditEntry(entryDto); return RedirectToAction("Index", "Blog", new { id = blogId }); }
public ActionResult EditEntry(int entryId) { EntryDto entryDto = _service.GetEntry(entryId); EntryViewModel viewModel = new EntryViewModel { BlogId = entryDto.BlogId, EntryId = entryDto.EntryId, Body = entryDto.Body, Title = entryDto.Title, Date = entryDto.Date }; return View(viewModel); }
public EntryPlatformViewModel() { Entry = new EntryViewModel(); EntryPlatformList = new List <EntryPlatformListViewModel>(); }
public ActionResult AddEntry(EntryViewModel model) { _service.AddEntry(model.BlogId, model.Title, model.Body); return RedirectToAction("Index", "Blog", new { id = model.BlogId }); }