public long AddProfileActionComment(ProfileActionComment comment) { using (var uow = _unitOfWorkFactory.Create()) { uow.ProfileActionComments.Add(comment); uow.Complete(); return(comment.ProfileActionCommentId); } }
public ActionResult AddComment(ProfileActionComment value) { if (_applicationManager.CurrentUser.ProfileId != value.ProfileId) { throw new AccessViolationException(nameof(value.ProfileId)); } value.Date = DateTime.Now; var actionCommentId = _profileService.AddProfileActionComment(value); var result = new LoadCommentResult { Profile = _profileService.GetShortProfile((long)_applicationManager.CurrentUser.ProfileId), Action = _profileService.GetProfileAction((long)value.ProfileActionId), ProfileActionComment = _profileService.GetProfileActionsComment(actionCommentId) }; return(PartialView("LoadComment", result)); }
public void RemoveComment(ProfileActionComment value) { _profileService.RemoveProfileActionsComment(value.ProfileActionCommentId, (long)_applicationManager.CurrentUser.ProfileId); }