//------------------------------------------------------------------------------
// <auto-generated>
//    This code was generated from a template.
//
//    Manual changes to this file may cause unexpected behavior in your application.
//    Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Data.Objects;
using System.Data.Objects.DataClasses;
using System.Data.EntityClient;
using System.ComponentModel;
using System.Xml.Serialization;
using System.Runtime.Serialization;

[assembly: EdmSchemaAttribute()]
#region EDM Relationship Metadata

[assembly: EdmRelationshipAttribute("MyTunesDatabaseModel", "FK_album_artist", "artist", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(MyTunes.Common.Entity.artist), "album", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(MyTunes.Common.Entity.album), true)]
[assembly: EdmRelationshipAttribute("MyTunesDatabaseModel", "FK_song_album", "album", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(MyTunes.Common.Entity.album), "song", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(MyTunes.Common.Entity.song), true)]
[assembly: EdmRelationshipAttribute("MyTunesDatabaseModel", "FK_song_artist", "artist", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(MyTunes.Common.Entity.artist), "song", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(MyTunes.Common.Entity.song), true)]
[assembly: EdmRelationshipAttribute("MyTunesDatabaseModel", "FK_playlist_customer", "customer", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(MyTunes.Common.Entity.customer), "playlist", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(MyTunes.Common.Entity.playlist), true)]
[assembly: EdmRelationshipAttribute("MyTunesDatabaseModel", "FK_playlist_item_playlist", "playlist", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(MyTunes.Common.Entity.playlist), "playlist_item", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(MyTunes.Common.Entity.playlist_item), true)]
[assembly: EdmRelationshipAttribute("MyTunesDatabaseModel", "FK_playlist_item_song", "song", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(MyTunes.Common.Entity.song), "playlist_item", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(MyTunes.Common.Entity.playlist_item), true)]

#endregion

namespace MyTunes.Common.Entity
{
    #region Contexts
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    public partial class MyTunesDatabaseEntities : ObjectContext
    {
        #region Constructors
    
        /// <summary>
        /// Initializes a new MyTunesDatabaseEntities object using the connection string found in the 'MyTunesDatabaseEntities' section of the application configuration file.
        /// </summary>
        public MyTunesDatabaseEntities() : base("name=MyTunesDatabaseEntities", "MyTunesDatabaseEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
        /// <summary>
        /// Initialize a new MyTunesDatabaseEntities object.
        /// </summary>
        public MyTunesDatabaseEntities(string connectionString) : base(connectionString, "MyTunesDatabaseEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
        /// <summary>
        /// Initialize a new MyTunesDatabaseEntities object.
        /// </summary>
        public MyTunesDatabaseEntities(EntityConnection connection) : base(connection, "MyTunesDatabaseEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
        #endregion
    
        #region Partial Methods
    
        partial void OnContextCreated();
    
        #endregion
    
        #region ObjectSet Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<album> albums
        {
            get
            {
                if ((_albums == null))
                {
                    _albums = base.CreateObjectSet<album>("albums");
                }
                return _albums;
            }
        }
        private ObjectSet<album> _albums;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<artist> artists
        {
            get
            {
                if ((_artists == null))
                {
                    _artists = base.CreateObjectSet<artist>("artists");
                }
                return _artists;
            }
        }
        private ObjectSet<artist> _artists;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<customer> customers
        {
            get
            {
                if ((_customers == null))
                {
                    _customers = base.CreateObjectSet<customer>("customers");
                }
                return _customers;
            }
        }
        private ObjectSet<customer> _customers;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<playlist> playlists
        {
            get
            {
                if ((_playlists == null))
                {
                    _playlists = base.CreateObjectSet<playlist>("playlists");
                }
                return _playlists;
            }
        }
        private ObjectSet<playlist> _playlists;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<playlist_item> playlist_item
        {
            get
            {
                if ((_playlist_item == null))
                {
                    _playlist_item = base.CreateObjectSet<playlist_item>("playlist_item");
                }
                return _playlist_item;
            }
        }
        private ObjectSet<playlist_item> _playlist_item;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<song> songs
        {
            get
            {
                if ((_songs == null))
                {
                    _songs = base.CreateObjectSet<song>("songs");
                }
                return _songs;
            }
        }
        private ObjectSet<song> _songs;

        #endregion
        #region AddTo Methods
    
        /// <summary>
        /// Deprecated Method for adding a new object to the albums EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToalbums(album album)
        {
            base.AddObject("albums", album);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the artists EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToartists(artist artist)
        {
            base.AddObject("artists", artist);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the customers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddTocustomers(customer customer)
        {
            base.AddObject("customers", customer);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the playlists EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToplaylists(playlist playlist)
        {
            base.AddObject("playlists", playlist);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the playlist_item EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToplaylist_item(playlist_item playlist_item)
        {
            base.AddObject("playlist_item", playlist_item);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the songs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddTosongs(song song)
        {
            base.AddObject("songs", song);
        }

        #endregion
    }
    

    #endregion
    
    #region Entities
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="MyTunesDatabaseModel", Name="album")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class album : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new album object.
        /// </summary>
        /// <param name="album_id">Initial value of the album_id property.</param>
        /// <param name="artist_id">Initial value of the artist_id property.</param>
        /// <param name="album1">Initial value of the album1 property.</param>
        public static album Createalbum(global::System.Int32 album_id, global::System.Int32 artist_id, global::System.String album1)
        {
            album album = new album();
            album.album_id = album_id;
            album.artist_id = artist_id;
            album.album1 = album1;
            return album;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 album_id
        {
            get
            {
                return _album_id;
            }
            set
            {
                if (_album_id != value)
                {
                    Onalbum_idChanging(value);
                    ReportPropertyChanging("album_id");
                    _album_id = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("album_id");
                    Onalbum_idChanged();
                }
            }
        }
        private global::System.Int32 _album_id;
        partial void Onalbum_idChanging(global::System.Int32 value);
        partial void Onalbum_idChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 artist_id
        {
            get
            {
                return _artist_id;
            }
            set
            {
                Onartist_idChanging(value);
                ReportPropertyChanging("artist_id");
                _artist_id = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("artist_id");
                Onartist_idChanged();
            }
        }
        private global::System.Int32 _artist_id;
        partial void Onartist_idChanging(global::System.Int32 value);
        partial void Onartist_idChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String album1
        {
            get
            {
                return _album1;
            }
            set
            {
                Onalbum1Changing(value);
                ReportPropertyChanging("album1");
                _album1 = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("album1");
                Onalbum1Changed();
            }
        }
        private global::System.String _album1;
        partial void Onalbum1Changing(global::System.String value);
        partial void Onalbum1Changed();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MyTunesDatabaseModel", "FK_album_artist", "artist")]
        public artist artist
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<artist>("MyTunesDatabaseModel.FK_album_artist", "artist").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<artist>("MyTunesDatabaseModel.FK_album_artist", "artist").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<artist> artistReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<artist>("MyTunesDatabaseModel.FK_album_artist", "artist");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<artist>("MyTunesDatabaseModel.FK_album_artist", "artist", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MyTunesDatabaseModel", "FK_song_album", "song")]
        public EntityCollection<song> songs
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<song>("MyTunesDatabaseModel.FK_song_album", "song");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<song>("MyTunesDatabaseModel.FK_song_album", "song", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="MyTunesDatabaseModel", Name="artist")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class artist : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new artist object.
        /// </summary>
        /// <param name="artist_id">Initial value of the artist_id property.</param>
        /// <param name="artist1">Initial value of the artist1 property.</param>
        public static artist Createartist(global::System.Int32 artist_id, global::System.String artist1)
        {
            artist artist = new artist();
            artist.artist_id = artist_id;
            artist.artist1 = artist1;
            return artist;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 artist_id
        {
            get
            {
                return _artist_id;
            }
            set
            {
                if (_artist_id != value)
                {
                    Onartist_idChanging(value);
                    ReportPropertyChanging("artist_id");
                    _artist_id = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("artist_id");
                    Onartist_idChanged();
                }
            }
        }
        private global::System.Int32 _artist_id;
        partial void Onartist_idChanging(global::System.Int32 value);
        partial void Onartist_idChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String artist1
        {
            get
            {
                return _artist1;
            }
            set
            {
                Onartist1Changing(value);
                ReportPropertyChanging("artist1");
                _artist1 = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("artist1");
                Onartist1Changed();
            }
        }
        private global::System.String _artist1;
        partial void Onartist1Changing(global::System.String value);
        partial void Onartist1Changed();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MyTunesDatabaseModel", "FK_album_artist", "album")]
        public EntityCollection<album> albums
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<album>("MyTunesDatabaseModel.FK_album_artist", "album");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<album>("MyTunesDatabaseModel.FK_album_artist", "album", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MyTunesDatabaseModel", "FK_song_artist", "song")]
        public EntityCollection<song> songs
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<song>("MyTunesDatabaseModel.FK_song_artist", "song");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<song>("MyTunesDatabaseModel.FK_song_artist", "song", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="MyTunesDatabaseModel", Name="customer")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class customer : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new customer object.
        /// </summary>
        /// <param name="customer_id">Initial value of the customer_id property.</param>
        /// <param name="email">Initial value of the email property.</param>
        /// <param name="password">Initial value of the password property.</param>
        /// <param name="expires">Initial value of the expires property.</param>
        /// <param name="is_admin">Initial value of the is_admin property.</param>
        /// <param name="username">Initial value of the username property.</param>
        public static customer Createcustomer(global::System.Int32 customer_id, global::System.String email, global::System.String password, global::System.DateTime expires, global::System.Boolean is_admin, global::System.String username)
        {
            customer customer = new customer();
            customer.customer_id = customer_id;
            customer.email = email;
            customer.password = password;
            customer.expires = expires;
            customer.is_admin = is_admin;
            customer.username = username;
            return customer;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 customer_id
        {
            get
            {
                return _customer_id;
            }
            set
            {
                if (_customer_id != value)
                {
                    Oncustomer_idChanging(value);
                    ReportPropertyChanging("customer_id");
                    _customer_id = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("customer_id");
                    Oncustomer_idChanged();
                }
            }
        }
        private global::System.Int32 _customer_id;
        partial void Oncustomer_idChanging(global::System.Int32 value);
        partial void Oncustomer_idChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String email
        {
            get
            {
                return _email;
            }
            set
            {
                OnemailChanging(value);
                ReportPropertyChanging("email");
                _email = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("email");
                OnemailChanged();
            }
        }
        private global::System.String _email;
        partial void OnemailChanging(global::System.String value);
        partial void OnemailChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String password
        {
            get
            {
                return _password;
            }
            set
            {
                OnpasswordChanging(value);
                ReportPropertyChanging("password");
                _password = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("password");
                OnpasswordChanged();
            }
        }
        private global::System.String _password;
        partial void OnpasswordChanging(global::System.String value);
        partial void OnpasswordChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime expires
        {
            get
            {
                return _expires;
            }
            set
            {
                OnexpiresChanging(value);
                ReportPropertyChanging("expires");
                _expires = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("expires");
                OnexpiresChanged();
            }
        }
        private global::System.DateTime _expires;
        partial void OnexpiresChanging(global::System.DateTime value);
        partial void OnexpiresChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String secret
        {
            get
            {
                return _secret;
            }
            set
            {
                OnsecretChanging(value);
                ReportPropertyChanging("secret");
                _secret = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("secret");
                OnsecretChanged();
            }
        }
        private global::System.String _secret;
        partial void OnsecretChanging(global::System.String value);
        partial void OnsecretChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.DateTime> secret_expires
        {
            get
            {
                return _secret_expires;
            }
            set
            {
                Onsecret_expiresChanging(value);
                ReportPropertyChanging("secret_expires");
                _secret_expires = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("secret_expires");
                Onsecret_expiresChanged();
            }
        }
        private Nullable<global::System.DateTime> _secret_expires;
        partial void Onsecret_expiresChanging(Nullable<global::System.DateTime> value);
        partial void Onsecret_expiresChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Boolean is_admin
        {
            get
            {
                return _is_admin;
            }
            set
            {
                Onis_adminChanging(value);
                ReportPropertyChanging("is_admin");
                _is_admin = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("is_admin");
                Onis_adminChanged();
            }
        }
        private global::System.Boolean _is_admin;
        partial void Onis_adminChanging(global::System.Boolean value);
        partial void Onis_adminChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String username
        {
            get
            {
                return _username;
            }
            set
            {
                OnusernameChanging(value);
                ReportPropertyChanging("username");
                _username = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("username");
                OnusernameChanged();
            }
        }
        private global::System.String _username;
        partial void OnusernameChanging(global::System.String value);
        partial void OnusernameChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MyTunesDatabaseModel", "FK_playlist_customer", "playlist")]
        public EntityCollection<playlist> playlists
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<playlist>("MyTunesDatabaseModel.FK_playlist_customer", "playlist");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<playlist>("MyTunesDatabaseModel.FK_playlist_customer", "playlist", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="MyTunesDatabaseModel", Name="playlist")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class playlist : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new playlist object.
        /// </summary>
        /// <param name="playlist_id">Initial value of the playlist_id property.</param>
        /// <param name="customer_id">Initial value of the customer_id property.</param>
        /// <param name="title">Initial value of the title property.</param>
        public static playlist Createplaylist(global::System.Int32 playlist_id, global::System.Int32 customer_id, global::System.String title)
        {
            playlist playlist = new playlist();
            playlist.playlist_id = playlist_id;
            playlist.customer_id = customer_id;
            playlist.title = title;
            return playlist;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 playlist_id
        {
            get
            {
                return _playlist_id;
            }
            set
            {
                if (_playlist_id != value)
                {
                    Onplaylist_idChanging(value);
                    ReportPropertyChanging("playlist_id");
                    _playlist_id = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("playlist_id");
                    Onplaylist_idChanged();
                }
            }
        }
        private global::System.Int32 _playlist_id;
        partial void Onplaylist_idChanging(global::System.Int32 value);
        partial void Onplaylist_idChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 customer_id
        {
            get
            {
                return _customer_id;
            }
            set
            {
                Oncustomer_idChanging(value);
                ReportPropertyChanging("customer_id");
                _customer_id = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("customer_id");
                Oncustomer_idChanged();
            }
        }
        private global::System.Int32 _customer_id;
        partial void Oncustomer_idChanging(global::System.Int32 value);
        partial void Oncustomer_idChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String title
        {
            get
            {
                return _title;
            }
            set
            {
                OntitleChanging(value);
                ReportPropertyChanging("title");
                _title = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("title");
                OntitleChanged();
            }
        }
        private global::System.String _title;
        partial void OntitleChanging(global::System.String value);
        partial void OntitleChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MyTunesDatabaseModel", "FK_playlist_customer", "customer")]
        public customer customer
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<customer>("MyTunesDatabaseModel.FK_playlist_customer", "customer").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<customer>("MyTunesDatabaseModel.FK_playlist_customer", "customer").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<customer> customerReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<customer>("MyTunesDatabaseModel.FK_playlist_customer", "customer");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<customer>("MyTunesDatabaseModel.FK_playlist_customer", "customer", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MyTunesDatabaseModel", "FK_playlist_item_playlist", "playlist_item")]
        public EntityCollection<playlist_item> playlist_item
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<playlist_item>("MyTunesDatabaseModel.FK_playlist_item_playlist", "playlist_item");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<playlist_item>("MyTunesDatabaseModel.FK_playlist_item_playlist", "playlist_item", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="MyTunesDatabaseModel", Name="playlist_item")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class playlist_item : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new playlist_item object.
        /// </summary>
        /// <param name="playlist_item_id">Initial value of the playlist_item_id property.</param>
        /// <param name="playlist_id">Initial value of the playlist_id property.</param>
        /// <param name="song_id">Initial value of the song_id property.</param>
        public static playlist_item Createplaylist_item(global::System.Int32 playlist_item_id, global::System.Int32 playlist_id, global::System.Int32 song_id)
        {
            playlist_item playlist_item = new playlist_item();
            playlist_item.playlist_item_id = playlist_item_id;
            playlist_item.playlist_id = playlist_id;
            playlist_item.song_id = song_id;
            return playlist_item;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 playlist_item_id
        {
            get
            {
                return _playlist_item_id;
            }
            set
            {
                if (_playlist_item_id != value)
                {
                    Onplaylist_item_idChanging(value);
                    ReportPropertyChanging("playlist_item_id");
                    _playlist_item_id = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("playlist_item_id");
                    Onplaylist_item_idChanged();
                }
            }
        }
        private global::System.Int32 _playlist_item_id;
        partial void Onplaylist_item_idChanging(global::System.Int32 value);
        partial void Onplaylist_item_idChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 playlist_id
        {
            get
            {
                return _playlist_id;
            }
            set
            {
                Onplaylist_idChanging(value);
                ReportPropertyChanging("playlist_id");
                _playlist_id = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("playlist_id");
                Onplaylist_idChanged();
            }
        }
        private global::System.Int32 _playlist_id;
        partial void Onplaylist_idChanging(global::System.Int32 value);
        partial void Onplaylist_idChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 song_id
        {
            get
            {
                return _song_id;
            }
            set
            {
                Onsong_idChanging(value);
                ReportPropertyChanging("song_id");
                _song_id = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("song_id");
                Onsong_idChanged();
            }
        }
        private global::System.Int32 _song_id;
        partial void Onsong_idChanging(global::System.Int32 value);
        partial void Onsong_idChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MyTunesDatabaseModel", "FK_playlist_item_playlist", "playlist")]
        public playlist playlist
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<playlist>("MyTunesDatabaseModel.FK_playlist_item_playlist", "playlist").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<playlist>("MyTunesDatabaseModel.FK_playlist_item_playlist", "playlist").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<playlist> playlistReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<playlist>("MyTunesDatabaseModel.FK_playlist_item_playlist", "playlist");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<playlist>("MyTunesDatabaseModel.FK_playlist_item_playlist", "playlist", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MyTunesDatabaseModel", "FK_playlist_item_song", "song")]
        public song song
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<song>("MyTunesDatabaseModel.FK_playlist_item_song", "song").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<song>("MyTunesDatabaseModel.FK_playlist_item_song", "song").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<song> songReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<song>("MyTunesDatabaseModel.FK_playlist_item_song", "song");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<song>("MyTunesDatabaseModel.FK_playlist_item_song", "song", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="MyTunesDatabaseModel", Name="song")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class song : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new song object.
        /// </summary>
        /// <param name="song_id">Initial value of the song_id property.</param>
        /// <param name="artist_id">Initial value of the artist_id property.</param>
        /// <param name="album_id">Initial value of the album_id property.</param>
        /// <param name="title">Initial value of the title property.</param>
        /// <param name="url">Initial value of the url property.</param>
        /// <param name="added">Initial value of the added property.</param>
        public static song Createsong(global::System.Int32 song_id, global::System.Int32 artist_id, global::System.Int32 album_id, global::System.String title, global::System.String url, global::System.DateTime added)
        {
            song song = new song();
            song.song_id = song_id;
            song.artist_id = artist_id;
            song.album_id = album_id;
            song.title = title;
            song.url = url;
            song.added = added;
            return song;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 song_id
        {
            get
            {
                return _song_id;
            }
            set
            {
                if (_song_id != value)
                {
                    Onsong_idChanging(value);
                    ReportPropertyChanging("song_id");
                    _song_id = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("song_id");
                    Onsong_idChanged();
                }
            }
        }
        private global::System.Int32 _song_id;
        partial void Onsong_idChanging(global::System.Int32 value);
        partial void Onsong_idChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 artist_id
        {
            get
            {
                return _artist_id;
            }
            set
            {
                Onartist_idChanging(value);
                ReportPropertyChanging("artist_id");
                _artist_id = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("artist_id");
                Onartist_idChanged();
            }
        }
        private global::System.Int32 _artist_id;
        partial void Onartist_idChanging(global::System.Int32 value);
        partial void Onartist_idChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 album_id
        {
            get
            {
                return _album_id;
            }
            set
            {
                Onalbum_idChanging(value);
                ReportPropertyChanging("album_id");
                _album_id = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("album_id");
                Onalbum_idChanged();
            }
        }
        private global::System.Int32 _album_id;
        partial void Onalbum_idChanging(global::System.Int32 value);
        partial void Onalbum_idChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String title
        {
            get
            {
                return _title;
            }
            set
            {
                OntitleChanging(value);
                ReportPropertyChanging("title");
                _title = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("title");
                OntitleChanged();
            }
        }
        private global::System.String _title;
        partial void OntitleChanging(global::System.String value);
        partial void OntitleChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String url
        {
            get
            {
                return _url;
            }
            set
            {
                OnurlChanging(value);
                ReportPropertyChanging("url");
                _url = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("url");
                OnurlChanged();
            }
        }
        private global::System.String _url;
        partial void OnurlChanging(global::System.String value);
        partial void OnurlChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String genre
        {
            get
            {
                return _genre;
            }
            set
            {
                OngenreChanging(value);
                ReportPropertyChanging("genre");
                _genre = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("genre");
                OngenreChanged();
            }
        }
        private global::System.String _genre;
        partial void OngenreChanging(global::System.String value);
        partial void OngenreChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String track
        {
            get
            {
                return _track;
            }
            set
            {
                OntrackChanging(value);
                ReportPropertyChanging("track");
                _track = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("track");
                OntrackChanged();
            }
        }
        private global::System.String _track;
        partial void OntrackChanging(global::System.String value);
        partial void OntrackChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String length
        {
            get
            {
                return _length;
            }
            set
            {
                OnlengthChanging(value);
                ReportPropertyChanging("length");
                _length = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("length");
                OnlengthChanged();
            }
        }
        private global::System.String _length;
        partial void OnlengthChanging(global::System.String value);
        partial void OnlengthChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime added
        {
            get
            {
                return _added;
            }
            set
            {
                OnaddedChanging(value);
                ReportPropertyChanging("added");
                _added = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("added");
                OnaddedChanged();
            }
        }
        private global::System.DateTime _added;
        partial void OnaddedChanging(global::System.DateTime value);
        partial void OnaddedChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.DateTime> modified
        {
            get
            {
                return _modified;
            }
            set
            {
                OnmodifiedChanging(value);
                ReportPropertyChanging("modified");
                _modified = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("modified");
                OnmodifiedChanged();
            }
        }
        private Nullable<global::System.DateTime> _modified;
        partial void OnmodifiedChanging(Nullable<global::System.DateTime> value);
        partial void OnmodifiedChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MyTunesDatabaseModel", "FK_song_album", "album")]
        public album album
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<album>("MyTunesDatabaseModel.FK_song_album", "album").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<album>("MyTunesDatabaseModel.FK_song_album", "album").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<album> albumReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<album>("MyTunesDatabaseModel.FK_song_album", "album");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<album>("MyTunesDatabaseModel.FK_song_album", "album", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MyTunesDatabaseModel", "FK_song_artist", "artist")]
        public artist artist
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<artist>("MyTunesDatabaseModel.FK_song_artist", "artist").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<artist>("MyTunesDatabaseModel.FK_song_artist", "artist").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<artist> artistReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<artist>("MyTunesDatabaseModel.FK_song_artist", "artist");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<artist>("MyTunesDatabaseModel.FK_song_artist", "artist", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("MyTunesDatabaseModel", "FK_playlist_item_song", "playlist_item")]
        public EntityCollection<playlist_item> playlist_item
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<playlist_item>("MyTunesDatabaseModel.FK_playlist_item_song", "playlist_item");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<playlist_item>("MyTunesDatabaseModel.FK_playlist_item_song", "playlist_item", value);
                }
            }
        }

        #endregion
    }

    #endregion
    
}
