Esempio n. 1
0
 public string ToSQLInsert()
 {
     return(string.Format("INSERT INTO `{0}` (`artist_id`, `name`, `creation_date`, `official_site`, `reviewer_id`, `countries`, `similar_artists_nodes`, `additionnal_similar_artists_names`, `sorting_weight`) VALUES ('{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', '{9}');"
                          , SQLTableName, Id, Name.ToCamelCase().GetSafeMySQL(), CreationDate.ToUnixTimeStamp(), OfficialUrl, Reviewer.Id
                          , Countries.Aggregate(string.Empty, (seed, entry) => seed + "|" + entry.CountryName.ToCamelCase().GetSafeMySQL()).Trim('|')
                          , SimilarArtists.Aggregate(string.Empty, (seed, entry) => seed + "|" + entry.Id).Trim('|')
                          , RawSimilarArtists.Aggregate(string.Empty, (seed, entry) => seed + "|" + entry.ToCamelCase().GetSafeMySQL()).Trim('|')
                          , SortWeight));
 }