Exemplo n.º 1
0
        public void UpdateRating(QueueItemModel video)
        {
            var element = mContext.Video.Where(e => e.SessionId == sessionId).Where(e => e.ItemId == video.Id).FirstOrDefault();

            element.Rating = video.Rating;
            mContext.SaveChanges();
        }
Exemplo n.º 2
0
        public void DeleteVideo(QueueItemModel video)
        {
            var element = mContext.Video.Where(e => e.SessionId == sessionId).Where(e => e.ItemId == video.Id).FirstOrDefault();

            mContext.Video.Remove(element);
            mContext.SaveChanges();
        }
Exemplo n.º 3
0
 public void WriteVideo(QueueItemModel video)
 {
     mContext.Database.EnsureCreated();
     mContext.Video.Add(new VideoDataModel
     {
         SessionId     = sessionId,
         ItemId        = video.Id,
         VideoId       = video.Video.VideoId,
         Name          = video.Video.Name,
         Channel       = video.Video.Channel,
         PublishedDate = video.Video.PublishedDate,
         Duration      = video.Video.Duration,
         Thumbnail     = video.Video.Thumbnail,
         Rating        = video.Rating
     });
     mContext.SaveChanges();
 }