public void ReviewEvent(VolunteerEventReview review) { try { var reviewEntity = Mapper.Map <Contracts.VolunteerEventReview, Data.Models.VolunteerEventReview>(review); _VaODbContext.VolunteerEventReviews.Add(reviewEntity); SaveChanges(); } catch { throw; } }
public IActionResult Post([FromBody] VolunteerEventReview review) { if (ModelState.IsValid) { try { _volunteerEventReviewRepository.ReviewEvent(review); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } } else { return(BadRequest(ModelState)); } }