public void Update(UserAccount user, int[] videoIds, Action <Video> updateMethod) { var vids = dataContext.Videos.AsQueryable() .Where(v => videoIds.Contains(v.Id)) .Where(v => v.Subscription.UserId == user.Id); vids.ForEach(updateMethod); dataContext.SaveChanges(); if (VideoUpdated != null) { foreach (var video in vids) { VideoUpdated.Invoke(this, new VideoUpdatedEventArgs() { User = user, Video = video }); } } }
private void NotifyVideoUpdated(ApiVideo video) { VideoUpdated?.Invoke(this, video); }