Ejemplo n.º 1
0
        private Video ParseVideoRow(DataRow r, bool attachRelated)
        {
            var updated = DateTime.Parse(r["Updated"].ToString());


            var video = new Video()
            {
                AmazonId    = r["AmazonId"].ToString(),
                Id          = Convert.ToInt32(r["Id"]),
                Created     = SQLUtils.ToDateTime(r["Created"].ToString()),
                Updated     = updated, //SQLUtils.ToDateTime(r["Updated"].ToString())
                Type        = (VideoType)Convert.ToInt32(r["Type"]),
                Url         = r["Url"].ToString(),
                Description = Convert.ToString(r["Description"]),
                Title       = r["Title"].ToString()
            };

            if (attachRelated)
            {
                foreach (var t in GetTags(video.Id.Value))
                {
                    video.AddTag(t);
                }

                foreach (RatingRecord rating in GetRatings(video.Id.Value))
                {
                    video.AddRating(rating);
                }
            }

            return(video);
        }