//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.4927
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

[assembly: global::System.Data.Objects.DataClasses.EdmSchemaAttribute()]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("ChinookModel", "FK__Album__ArtistId__276EDEB3", "Artist", global::System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(MasterDetailsWithRIAServices.Web.Models.Artist), "Album", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(MasterDetailsWithRIAServices.Web.Models.Album))]

// Original file name:
// Generation date: 1/7/2010 1:06:55 PM
namespace MasterDetailsWithRIAServices.Web.Models
{
    
    /// <summary>
    /// There are no comments for ChinookEntities in the schema.
    /// </summary>
    public partial class ChinookEntities : global::System.Data.Objects.ObjectContext
    {
        /// <summary>
        /// Initializes a new ChinookEntities object using the connection string found in the 'ChinookEntities' section of the application configuration file.
        /// </summary>
        public ChinookEntities() : 
                base("name=ChinookEntities", "ChinookEntities")
        {
            this.OnContextCreated();
        }
        /// <summary>
        /// Initialize a new ChinookEntities object.
        /// </summary>
        public ChinookEntities(string connectionString) : 
                base(connectionString, "ChinookEntities")
        {
            this.OnContextCreated();
        }
        /// <summary>
        /// Initialize a new ChinookEntities object.
        /// </summary>
        public ChinookEntities(global::System.Data.EntityClient.EntityConnection connection) : 
                base(connection, "ChinookEntities")
        {
            this.OnContextCreated();
        }
        partial void OnContextCreated();
        /// <summary>
        /// There are no comments for Album in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Album> Album
        {
            get
            {
                if ((this._Album == null))
                {
                    this._Album = base.CreateQuery<Album>("[Album]");
                }
                return this._Album;
            }
        }
        private global::System.Data.Objects.ObjectQuery<Album> _Album;
        /// <summary>
        /// There are no comments for Artist in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Artist> Artist
        {
            get
            {
                if ((this._Artist == null))
                {
                    this._Artist = base.CreateQuery<Artist>("[Artist]");
                }
                return this._Artist;
            }
        }
        private global::System.Data.Objects.ObjectQuery<Artist> _Artist;
        /// <summary>
        /// There are no comments for Album in the schema.
        /// </summary>
        public void AddToAlbum(Album album)
        {
            base.AddObject("Album", album);
        }
        /// <summary>
        /// There are no comments for Artist in the schema.
        /// </summary>
        public void AddToArtist(Artist artist)
        {
            base.AddObject("Artist", artist);
        }
    }
    /// <summary>
    /// There are no comments for ChinookModel.Album in the schema.
    /// </summary>
    /// <KeyProperties>
    /// AlbumId
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="ChinookModel", Name="Album")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Album : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Album object.
        /// </summary>
        /// <param name="albumId">Initial value of AlbumId.</param>
        /// <param name="title">Initial value of Title.</param>
        public static Album CreateAlbum(int albumId, string title)
        {
            Album album = new Album();
            album.AlbumId = albumId;
            album.Title = title;
            return album;
        }
        /// <summary>
        /// There are no comments for Property AlbumId in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public int AlbumId
        {
            get
            {
                return this._AlbumId;
            }
            set
            {
                this.OnAlbumIdChanging(value);
                this.ReportPropertyChanging("AlbumId");
                this._AlbumId = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
                this.ReportPropertyChanged("AlbumId");
                this.OnAlbumIdChanged();
            }
        }
        private int _AlbumId;
        partial void OnAlbumIdChanging(int value);
        partial void OnAlbumIdChanged();
        /// <summary>
        /// There are no comments for Property Title in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string Title
        {
            get
            {
                return this._Title;
            }
            set
            {
                this.OnTitleChanging(value);
                this.ReportPropertyChanging("Title");
                this._Title = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, false);
                this.ReportPropertyChanged("Title");
                this.OnTitleChanged();
            }
        }
        private string _Title;
        partial void OnTitleChanging(string value);
        partial void OnTitleChanged();
        /// <summary>
        /// There are no comments for Artist in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("ChinookModel", "FK__Album__ArtistId__276EDEB3", "Artist")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public Artist Artist
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Artist>("ChinookModel.FK__Album__ArtistId__276EDEB3", "Artist").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Artist>("ChinookModel.FK__Album__ArtistId__276EDEB3", "Artist").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for Artist in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<Artist> ArtistReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Artist>("ChinookModel.FK__Album__ArtistId__276EDEB3", "Artist");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Artist>("ChinookModel.FK__Album__ArtistId__276EDEB3", "Artist", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for ChinookModel.Artist in the schema.
    /// </summary>
    /// <KeyProperties>
    /// ArtistId
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="ChinookModel", Name="Artist")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Artist : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Artist object.
        /// </summary>
        /// <param name="artistId">Initial value of ArtistId.</param>
        public static Artist CreateArtist(int artistId)
        {
            Artist artist = new Artist();
            artist.ArtistId = artistId;
            return artist;
        }
        /// <summary>
        /// There are no comments for Property ArtistId in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public int ArtistId
        {
            get
            {
                return this._ArtistId;
            }
            set
            {
                this.OnArtistIdChanging(value);
                this.ReportPropertyChanging("ArtistId");
                this._ArtistId = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
                this.ReportPropertyChanged("ArtistId");
                this.OnArtistIdChanged();
            }
        }
        private int _ArtistId;
        partial void OnArtistIdChanging(int value);
        partial void OnArtistIdChanged();
        /// <summary>
        /// There are no comments for Property Name in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this.OnNameChanging(value);
                this.ReportPropertyChanging("Name");
                this._Name = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("Name");
                this.OnNameChanged();
            }
        }
        private string _Name;
        partial void OnNameChanging(string value);
        partial void OnNameChanged();
        /// <summary>
        /// There are no comments for Album in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("ChinookModel", "FK__Album__ArtistId__276EDEB3", "Album")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Album> Album
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Album>("ChinookModel.FK__Album__ArtistId__276EDEB3", "Album");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Album>("ChinookModel.FK__Album__ArtistId__276EDEB3", "Album", value);
                }
            }
        }
    }
}
