public async Task <DonationPostDTO> Edit(DonationPostDTO dto) { dto.UserId = Session.UserId; var donationPost = dto.MapTo <TDonationPost>(); await donationPostRepository.Edit(donationPost, Session); return(donationPost.MapTo <DonationPostDTO>()); }
public async Task <IActionResult> PutDonationPost(DonationPostDTO donationPostDto) { var donationPost = await donationPostService.Edit(donationPostDto); if (donationPost == null) { return(BadRequest()); } return(Ok(donationPost)); }
public async Task <ActionResult <DonationPostDTO> > PostDonationPost(DonationPostDTO donationPostDto) { try { var ilyes = donationPostDto; int i = 10; var donationPost = await donationPostService.Edit(donationPostDto); i = 20; return(Ok(donationPost)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }