Exemplo n.º 1
0
        public ActionResult <Comment> CreateCommentForBiography(Guid biographyId, Guid userId, Comment comment)
        {
            _biographyRepository.AddComment(biographyId, userId, comment);
            _biographyRepository.Save();

            return(Ok(comment));
        }
Exemplo n.º 2
0
        public ActionResult <GalleryImage> CreateCommentForBiography(Guid userId, GalleryImage galleryImage)
        {
            _biographyRepository.AddGalleryImage(userId, galleryImage);
            _biographyRepository.Save();

            return(Ok(galleryImage));
        }
Exemplo n.º 3
0
        public ActionResult UpdateUser(Guid biographyId, Biography biography)
        {
            var biographyToUpdateFromRepo = _biographyRepository.GetBiography(biographyId);

            biographyToUpdateFromRepo.Id      = biography.Id;
            biographyToUpdateFromRepo.Content = biography.Content;
            biographyToUpdateFromRepo.UserId  = biography.UserId;
            _biographyRepository.Save();

            return(Ok(biography));
        }
Exemplo n.º 4
0
        public ActionResult UpdateUser(Guid userId, User user)
        {
            var userToUpdateFromRepo = _biographyRepository.GetUser(userId);

            userToUpdateFromRepo.Age         = user.Age;
            userToUpdateFromRepo.AvatarImage = user.AvatarImage;
            userToUpdateFromRepo.Username    = user.Username;
            userToUpdateFromRepo.Email       = user.Email;
            userToUpdateFromRepo.Name        = user.Name;
            userToUpdateFromRepo.Id          = user.Id;
            _biographyRepository.Save();

            return(Ok(user));
        }