/// <summary>
 /// Static create function (for use in LINQ queries, etc.)
 /// </summary>
 /// <param name="providerid"></param>
 /// <param name="_metadata0"></param>
 /// <param name="_person1"></param>
 /// <param name="_personrole2"></param>
 /// <param name="_ratingsource3"></param>
 public static MetadataProviderId Create(string providerid, Metadata _metadata0, Person _person1, PersonRole _personrole2, RatingSource _ratingsource3)
 {
     return(new MetadataProviderId(providerid, _metadata0, _person1, _personrole2, _ratingsource3));
 }
        /// <summary>
        /// Public constructor with required data
        /// </summary>
        /// <param name="providerid"></param>
        /// <param name="_metadata0"></param>
        /// <param name="_person1"></param>
        /// <param name="_personrole2"></param>
        /// <param name="_ratingsource3"></param>
        public MetadataProviderId(string providerid, Metadata _metadata0, Person _person1, PersonRole _personrole2, RatingSource _ratingsource3)
        {
            // NOTE: This class has one-to-one associations with MetadataProviderId.
            // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.

            if (string.IsNullOrEmpty(providerid))
            {
                throw new ArgumentNullException(nameof(providerid));
            }
            this.ProviderId = providerid;

            if (_metadata0 == null)
            {
                throw new ArgumentNullException(nameof(_metadata0));
            }
            _metadata0.Sources.Add(this);

            if (_person1 == null)
            {
                throw new ArgumentNullException(nameof(_person1));
            }
            _person1.Sources.Add(this);

            if (_personrole2 == null)
            {
                throw new ArgumentNullException(nameof(_personrole2));
            }
            _personrole2.Sources.Add(this);

            if (_ratingsource3 == null)
            {
                throw new ArgumentNullException(nameof(_ratingsource3));
            }
            _ratingsource3.Source = this;


            Init();
        }