public void RateUser(string userToRateId, string fromUserId, int rating, TripNotification tripNotification)
        {
            Rating ratingToBeSaved = new Rating()
            {
                RatedUserId = userToRateId,
                FromUserId = fromUserId,
                Value = rating,
            };

            this.ratingRepos.Add(ratingToBeSaved);
            this.ratingRepos.Save();

            this.tipNotificationServices.SetTripFinishActionHasBeenTakenToTrue(tripNotification);
        }
        public TripNotification Create(
            int tripId,
            string fromUserId,
            string forUserId,
            string title,
            string message,
            NotificationKey keyType,
            DateTime dueTo)
        {
            NotificationType type = this.notificationTypeRepos
                .All()
                .Where(t => t.Key == keyType)
                .FirstOrDefault();

            if (type == null)
            {
                throw new Exception("No such type, given key type " + keyType);
            }

            TripNotification tripNotification = new TripNotification()
            {
                TripId = tripId,
                FromUserId = fromUserId,
                ForUserId = forUserId,
                Title = title,
                Message = message,
                Seen = false,
                AvailableAfter = DateTime.Now,
                DueTo = dueTo,
                Type = type
            };

            this.tripNotificationRepos.Add(tripNotification);
            this.tripNotificationRepos.Save();
            return tripNotification;
        }
 public void SetTripFinishActionHasBeenTakenToTrue(TripNotification tripNotification)
 {
     tripNotification.ActionHasBeenTaken = true;
     this.tripNotificationRepos.Save();
 }