Esempio n. 1
0
 public ActionResult MakeaComment(MakeaCommentModel model)
 {
     var reply = Mapper.Map<MakeaCommentModel, NewsReply>(model);
     var user = GetAccountFromUserNameorEmail();
     reply.UserId = user.Id;
     var theNew = _readOnlyRepository.First<News>(x => x.Id == model.NewId);
     reply = _writeOnlyRepository.Create(reply);
     theNew.RepliesListIds.Add(reply.Id);
     _writeOnlyRepository.Update(theNew);
     return RedirectToAction("Comments", new {id = model.NewId});
 }
Esempio n. 2
0
 public ActionResult MakeaComment(long id)
 {
     var model = new MakeaCommentModel();
     model.NewId = id;
     return PartialView(model);
 }