Example #1
0
        public void Save(CommentingUserAccountModel model)
        {
            var          currentUser = CurrentRequestData.CurrentUser;
            CommentsInfo commentsInfo;

            if (currentUser.Get <CommentsInfo>() != null)
            {
                commentsInfo = currentUser.Get <CommentsInfo>();
            }
            else
            {
                commentsInfo = new CommentsInfo {
                    User = currentUser
                };
                _userProfileDataService.Add(commentsInfo);
            }

            _session.Transact(session =>
            {
                commentsInfo.Username = model.Username;
                session.SaveOrUpdate(commentsInfo);
            });
        }
Example #2
0
 public RedirectToRouteResult Add(AuthorInfo info)
 {
     _userProfileDataService.Add(info);
     return(RedirectToAction("Edit", "User", new { id = info.User.Id }));
 }