예제 #1
0
        /// <summary>
        /// Public constructor with required data
        /// </summary>
        /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
        /// <param name="_musicalbum0"></param>
        public Track(Guid urlid, DateTime dateadded, MusicAlbum _musicalbum0)
        {
            // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem.
            // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.

            this.UrlId = urlid;

            if (_musicalbum0 == null)
            {
                throw new ArgumentNullException(nameof(_musicalbum0));
            }
            _musicalbum0.Tracks.Add(this);

            this.Releases      = new HashSet <Release>();
            this.TrackMetadata = new HashSet <TrackMetadata>();

            Init();
        }
예제 #2
0
 /// <summary>
 /// Static create function (for use in LINQ queries, etc.)
 /// </summary>
 /// <param name="title">The title or name of the object.</param>
 /// <param name="language">ISO-639-3 3-character language codes.</param>
 /// <param name="_musicalbum0"></param>
 public static MusicAlbumMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, MusicAlbum _musicalbum0)
 {
     return(new MusicAlbumMetadata(title, language, dateadded, datemodified, _musicalbum0));
 }
예제 #3
0
        /// <summary>
        /// Public constructor with required data.
        /// </summary>
        /// <param name="title">The title or name of the object.</param>
        /// <param name="language">ISO-639-3 3-character language codes.</param>
        /// <param name="_musicalbum0"></param>
        public MusicAlbumMetadata(string title, string language, DateTime dateadded, DateTime datemodified, MusicAlbum _musicalbum0)
        {
            if (string.IsNullOrEmpty(title))
            {
                throw new ArgumentNullException(nameof(title));
            }

            this.Title = title;

            if (string.IsNullOrEmpty(language))
            {
                throw new ArgumentNullException(nameof(language));
            }

            this.Language = language;

            if (_musicalbum0 == null)
            {
                throw new ArgumentNullException(nameof(_musicalbum0));
            }

            _musicalbum0.MusicAlbumMetadata.Add(this);

            this.Labels = new HashSet <Company>();

            Init();
        }
예제 #4
0
 /// <summary>
 /// Static create function (for use in LINQ queries, etc.)
 /// </summary>
 /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
 /// <param name="_musicalbum0"></param>
 public static Track Create(Guid urlid, DateTime dateadded, MusicAlbum _musicalbum0)
 {
     return(new Track(urlid, dateadded, _musicalbum0));
 }