Пример #1
0
        public ActionResult <Comment> CreateCommentForBiography(Guid biographyId, Guid userId, Comment comment)
        {
            _biographyRepository.AddComment(biographyId, userId, comment);
            _biographyRepository.Save();

            return(Ok(comment));
        }
Пример #2
0
        public ActionResult <GalleryImage> CreateCommentForBiography(Guid userId, GalleryImage galleryImage)
        {
            _biographyRepository.AddGalleryImage(userId, galleryImage);
            _biographyRepository.Save();

            return(Ok(galleryImage));
        }
Пример #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));
        }
Пример #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));
        }