//post photo api //should return rp public ActionResult <PhotoAddRp> AddPhoto(PhotoAddRt rt) { var photo = _mapper.Map <Photo>(rt); _photoRepository.AddPhoto(photo); _photoRepository.SaveChanges(); return(Ok(_mapper.Map <PhotoAddRp>(photo))); }
public ActionResult <char> UploadPhoto([FromForm] PhotoAddRt form) { //save photo var photo = _mapper.Map <Photo>(form); //hardcode photo.ByUserId = 1; _photoRepository.AddPhoto(photo); _photoRepository.SaveChanges(); return('a'); }
public void AddPhotoByUser(PhotoAddRt photoForm) { Console.Write(photoForm); _context.Add(photoForm); }