Inheritance: TableStorageEntity
Exemple #1
0
        public static ArtistEntity CreateArtistEntity(string artistName, string uniqueName, string bio, string born, string movieList, string popularity, string posters, string myScore, string jsonString, string twitterHandle)
        {
            var artistId     = Guid.NewGuid().ToString();
            var artistEntity = new ArtistEntity(uniqueName.ToLower());

            artistEntity.ArtistId      = artistId;
            artistEntity.ArtistName    = artistName;
            artistEntity.UniqueName    = uniqueName;
            artistEntity.Bio           = bio;
            artistEntity.Born          = born;
            artistEntity.MovieList     = movieList;
            artistEntity.Popularity    = popularity;
            artistEntity.Posters       = posters;
            artistEntity.MyScore       = myScore;
            artistEntity.JsonString    = jsonString;
            artistEntity.TwitterHandle = twitterHandle;
            return(artistEntity);
        }
Exemple #2
0
        public ArtistEntity PopulateArtistsDetails(string html, string url)
        {
            try
            {
                ArtistEntity artist = new ArtistEntity();
                HtmlAgilityPack.HtmlDocument htmlDoc = new HtmlAgilityPack.HtmlDocument();
                htmlDoc.OptionFixNestedTags = true;
                htmlDoc.LoadHtml(html);
                if (htmlDoc.DocumentNode != null)
                {
                    HtmlAgilityPack.HtmlNode bodyNode = htmlDoc.DocumentNode.SelectSingleNode("//body");
                    if (bodyNode == null)
                    {
                        Console.WriteLine("body node is null");
                    }
                    else
                    {
                        artist.RowKey = artist.ArtistId = Guid.NewGuid().ToString();
                        artist.ArtistName = GetArtistName(bodyNode);
                        artist.UniqueName = artist.ArtistName.Replace(" ", "-");
                        artist.Bio = GetArtistBio(bodyNode);
                        artist.Born = GetArtistBirthDetails(bodyNode);
                        artist.MovieList = GetMovieList(bodyNode);
                        artist.Posters = GetArtistPosters(url + "mediaindex", artist.UniqueName, bodyNode);
                        artist.Popularity = Util.DEFAULT_POPULARITY;
                        artist.MyScore = Util.DEFAULT_SCORE;
                        artist.JsonString = string.Empty;
                    }
                }

                return artist;
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.Message);
                return null;
            }
        }
Exemple #3
0
        public static bool UpdateArtistById(this IStore store, ArtistEntity artist)
        {
            Debug.Assert(artist != null);
            var list = new List<ArtistEntity> { artist };
            var retList = store.UpdateArtistItemById(list);

            Debug.Assert(retList.Count == 1);
            var key = retList.Keys.FirstOrDefault();
            return (key != null) ? retList[key] : false;
        }
Exemple #4
0
 public ArtistEntity(ArtistEntity artist)
     : base(artist.PartitionKey, artist.RowKey)
 {
 }
Exemple #5
0
 public ArtistEntity(ArtistEntity artist)
     : base(artist.PartitionKey, artist.RowKey)
 {
 }
Exemple #6
0
        public static ArtistEntity CreateArtistEntity(string artistName, string uniqueName, string bio, string born, string movieList, string popularity,
            string posters, string myScore, string jsonString, string twitterHandle, string artistNickName, string age, string familyRelation, string dateOfBirth,
            string bornCity, string zodiacSign, string hobbies, string educationDetails, string socialActivities, string debutFilms, string rememberMovie, string awards,
            string facebookUrl, string instagramUrl, string summary)
        {
            var artistId = Guid.NewGuid().ToString();
            var artistEntity = new ArtistEntity(uniqueName.ToLower());
            artistEntity.ArtistId = artistId;
            artistEntity.ArtistName = artistName;
            artistEntity.UniqueName = uniqueName;
            artistEntity.Bio = bio;
            artistEntity.Born = born;
            artistEntity.MovieList = movieList;
            artistEntity.Popularity = popularity;
            artistEntity.Posters = posters;
            artistEntity.MyScore = myScore;
            artistEntity.JsonString = jsonString;
            artistEntity.TwitterHandle = twitterHandle;

            //added by vasim
            artistEntity.ArtistNickName = artistNickName;
            artistEntity.Age = age;
            artistEntity.FamilyRelation = familyRelation;
            artistEntity.DateOfBirth = dateOfBirth;
            artistEntity.BornCity = bornCity;
            artistEntity.ZodiacSign = zodiacSign;
            artistEntity.Hobbies = hobbies;
            artistEntity.EducationDetails = educationDetails;
            artistEntity.SocialActivities = socialActivities;
            artistEntity.DebutFilms = debutFilms;
            artistEntity.RememberForMovies = rememberMovie;
            artistEntity.Awards = awards;
            artistEntity.FacebookURL = facebookUrl;
            artistEntity.InstagramURL = instagramUrl;
            artistEntity.Summary = summary;
            //end

            return artistEntity;
        }
        public ArtistEntity GetArtistEntity()
        {
            ArtistEntity artistEntity = new ArtistEntity();

            artistEntity.ArtistId = this.ArtistId;
            artistEntity.ArtistName = this.ArtistName;
            artistEntity.UniqueName = this.UniqueName ;
            artistEntity.Bio = this.Bio;
            artistEntity.Born = this.Born;
            artistEntity.MovieList = this.MovieList;
            artistEntity.Popularity = this.Popularity;
            artistEntity.Posters = this.Posters;
            artistEntity.MyScore = this.MyScore;
            artistEntity.JsonString = this.JsonString;
            artistEntity.TwitterHandle = this.TwitterHandle;
            artistEntity.ArtistNickName = this.ArtistNickName;
            artistEntity.Age = this.Age;
            artistEntity.FamilyRelation = this.FamilyRelation;
            artistEntity.DateOfBirth = this.DateOfBirth;
            artistEntity.BornCity = this.BornCity;
            artistEntity.ZodiacSign = this.ZodiacSign;
            artistEntity.Hobbies = this.Hobbies ;
            artistEntity.EducationDetails = this.EducationDetails;
            artistEntity.SocialActivities = this.SocialActivities;
            artistEntity.DebutFilms = this.DebutFilms;
            artistEntity.RememberForMovies = this.RememberForMovies;
            artistEntity.Awards = this.Awards;
            artistEntity.FacebookURL = this.FacebookURL;
            artistEntity.InstagramURL = this.InstagramURL;
            artistEntity.Summary = this.Summary;

            return artistEntity;
        }