public ActionResult <Comment> CreateCommentForBiography(Guid biographyId, Guid userId, Comment comment) { _biographyRepository.AddComment(biographyId, userId, comment); _biographyRepository.Save(); return(Ok(comment)); }
public ActionResult <GalleryImage> CreateCommentForBiography(Guid userId, GalleryImage galleryImage) { _biographyRepository.AddGalleryImage(userId, galleryImage); _biographyRepository.Save(); return(Ok(galleryImage)); }
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)); }
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)); }