Beispiel #1
0
        private List <Channel> GetListChannel()
        {
            var db         = new youtubeEntities();
            var lstChannel = db.Database.SqlQuery <Channel>("yt_Get_Channel").ToList();

            return(lstChannel);
        }
Beispiel #2
0
        private int SaveVideo(PlaylistItem playlistItem)
        {
            var             db       = new youtubeEntities();
            ObjectParameter objParam = new ObjectParameter("ReturnId", typeof(int));
            var             videoid  = db.yt_Save_Video(
                playlistItem.Snippet.ChannelId,
                playlistItem.Snippet.ResourceId.VideoId,
                playlistItem.Snippet.Title,
                playlistItem.Snippet.Thumbnails.Default__.Url, objParam);

            return(Convert.ToInt32(objParam.Value));
        }
Beispiel #3
0
        private int SaveVideoNumberCount(int videoid, Google.Apis.YouTube.v3.Data.Video video)
        {
            var             db       = new youtubeEntities();
            ObjectParameter objParam = new ObjectParameter("Id", typeof(int));

            var videoNumberCountId = db.yt_Save_Video_NumberCount(
                videoid,
                ParseData.GetLong(video.Statistics.ViewCount),
                ParseData.GetLong(video.Statistics.LikeCount),
                ParseData.GetLong(video.Statistics.DislikeCount),
                ParseData.GetLong(video.Statistics.FavoriteCount),
                ParseData.GetLong(video.Statistics.CommentCount)
                , objParam);

            return(Convert.ToInt32(objParam.Value));
        }