예제 #1
0
 public void ReviewEvent(VolunteerEventReview review)
 {
     try
     {
         var reviewEntity = Mapper.Map <Contracts.VolunteerEventReview, Data.Models.VolunteerEventReview>(review);
         _VaODbContext.VolunteerEventReviews.Add(reviewEntity);
         SaveChanges();
     }
     catch
     {
         throw;
     }
 }
예제 #2
0
 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));
     }
 }