public async Task <bool> RequestDifficultyRatingPost(GolfCourseHoleRatingViewModel userDifficultyRating, string userId) { var golfCourseComment = new GolfCourseComment { DifficultyRating = userDifficultyRating.Difficulty, GolfCourseId = userDifficultyRating.GolfCourseId, HoleComment = userDifficultyRating.Comment, HoleNumber = userDifficultyRating.HoleNumber, UserId = userId }; return(await _golfCourseRepository.StoreDifficultyRating(golfCourseComment)); }
public async Task <bool> StoreDifficultyRating(GolfCourseComment difficultyRatingComment) { try { _dataEntities.GolfCourseComments.Add(difficultyRatingComment); await _dataEntities.SaveChangesAsync(); return(true); } catch (Exception e) { e.GetBaseException(); return(false); } }