Ejemplo n.º 1
0
        /// <summary>
        /// 获取一个新的<see cref="ArtistModel"/>实例,如果已经创建过则返回这个实例
        /// </summary>
        /// <param name="XiamiID">标志<see cref="ArtistModel"/>的虾米ID</param>
        /// <returns></returns>
        public static ArtistModel GetNew(uint XiamiID)
        {
            ArtistModel artist = null;

            if (!(_dict?.TryGetValue(XiamiID, out artist) ?? false))
            {
                artist = new ArtistModel()
                {
                    XiamiID = XiamiID
                };
                _dict?.Add(XiamiID, artist);
            }
            return(artist);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 获取艺人电台
 /// </summary>
 public static RadioModel GetFromArtist(ArtistModel artist) => GetNew(RadioType.Artist, artist.XiamiID);