//comments public bool AddComment(string text, ObjectId postId) { Comment comment = new Comment(); comment.Text = text; comment.CommentatorId = userRepository.GetUser(userServices.NickNameRead()).Id; try { repository.AddComment(comment, postId); return(true); } catch { return(false); } }
public bool CheckPassword(string nickname, string password) { User user = new User(); user = repository.GetUser(nickname); if (user != null) { if (user.Password == GetHashStringSHA256(password)) { return(true); } else { return(false); } } return(false); }