Example #1
0
        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
                    });
                }
            }
        }
Example #2
0
 private void NotifyVideoUpdated(ApiVideo video)
 {
     VideoUpdated?.Invoke(this, video);
 }