Exemple #1
0
 private void OnRatingTypeDeleted(RatingTypeDeleted @event)
 {
     if (_ratingTypes.ContainsKey(@event.RatingTypeId))
     {
         _ratingTypes.Remove(@event.RatingTypeId);
     }
 }
 public void Handle(RatingTypeDeleted @event)
 {
     using (var context = _contextFactory.Invoke())
     {
         var ratingTypes = context.Query <RatingTypeDetail>().Where(x => x.Id == @event.RatingTypeId);
         foreach (var ratingType in ratingTypes)
         {
             context.Set <RatingTypeDetail>().Remove(ratingType);
         }
         context.SaveChanges();
     }
 }