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

namespace MyTunes.Library
{
	using System.Data.Linq;
	using System.Data.Linq.Mapping;
	using System.Data;
	using System.Collections.Generic;
	using System.Reflection;
	using System.Linq;
	using System.Linq.Expressions;
	using System.ComponentModel;
	using System;
	
	
	[global::System.Data.Linq.Mapping.DatabaseAttribute(Name="MyTunesDatabase")]
	public partial class MyTunesDataContext : System.Data.Linq.DataContext
	{
		
		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
		
    #region Extensibility Method Definitions
    partial void OnCreated();
    partial void InsertArtist(Artist instance);
    partial void UpdateArtist(Artist instance);
    partial void DeleteArtist(Artist instance);
    partial void InsertAlbum(Album instance);
    partial void UpdateAlbum(Album instance);
    partial void DeleteAlbum(Album instance);
    partial void InsertSong(Song instance);
    partial void UpdateSong(Song instance);
    partial void DeleteSong(Song instance);
    partial void InsertPlaylistItem(PlaylistItem instance);
    partial void UpdatePlaylistItem(PlaylistItem instance);
    partial void DeletePlaylistItem(PlaylistItem instance);
    partial void InsertPlaylist(Playlist instance);
    partial void UpdatePlaylist(Playlist instance);
    partial void DeletePlaylist(Playlist instance);
    #endregion
		
		public MyTunesDataContext() : 
				base("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\MyTunesDatabase.mdf;Int" +
						"egrated Security=True;User Instance=True", mappingSource)
		{
			OnCreated();
		}
		
		public MyTunesDataContext(string connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public MyTunesDataContext(System.Data.IDbConnection connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public MyTunesDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public MyTunesDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public System.Data.Linq.Table<Artist> Artists
		{
			get
			{
				return this.GetTable<Artist>();
			}
		}
		
		public System.Data.Linq.Table<Album> Albums
		{
			get
			{
				return this.GetTable<Album>();
			}
		}
		
		public System.Data.Linq.Table<Song> Songs
		{
			get
			{
				return this.GetTable<Song>();
			}
		}
		
		public System.Data.Linq.Table<PlaylistItem> PlaylistItems
		{
			get
			{
				return this.GetTable<PlaylistItem>();
			}
		}
		
		public System.Data.Linq.Table<Playlist> Playlists
		{
			get
			{
				return this.GetTable<Playlist>();
			}
		}
		
		public System.Data.Linq.Table<SongView> SongViews
		{
			get
			{
				return this.GetTable<SongView>();
			}
		}
		
		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.GetArtistLetterIndex")]
		public ISingleResult<GetArtistLetterIndexResult> GetArtistLetterIndex()
		{
			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));
			return ((ISingleResult<GetArtistLetterIndexResult>)(result.ReturnValue));
		}
		
		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.GetAlbumLetterIndex")]
		public ISingleResult<GetAlbumLetterIndexResult> GetAlbumLetterIndex()
		{
			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));
			return ((ISingleResult<GetAlbumLetterIndexResult>)(result.ReturnValue));
		}
		
		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.GetSongLetterIndex")]
		public ISingleResult<GetSongLetterIndexResult> GetSongLetterIndex()
		{
			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));
			return ((ISingleResult<GetSongLetterIndexResult>)(result.ReturnValue));
		}
		
		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.GetAlbumsByArtistLetter")]
		public int GetAlbumsByArtistLetter([global::System.Data.Linq.Mapping.ParameterAttribute(DbType="NChar(1)")] System.Nullable<char> artistLetter)
		{
			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), artistLetter);
			return ((int)(result.ReturnValue));
		}
		
		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.GetAlbumsByLetter")]
		public int GetAlbumsByLetter([global::System.Data.Linq.Mapping.ParameterAttribute(DbType="NChar(1)")] System.Nullable<char> letter)
		{
			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), letter);
			return ((int)(result.ReturnValue));
		}
		
		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.GetAlbumsBySongLetter")]
		public int GetAlbumsBySongLetter([global::System.Data.Linq.Mapping.ParameterAttribute(DbType="NChar(1)")] System.Nullable<char> songLetter)
		{
			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), songLetter);
			return ((int)(result.ReturnValue));
		}
		
		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.GetArtistsByAlbumLetter")]
		public int GetArtistsByAlbumLetter([global::System.Data.Linq.Mapping.ParameterAttribute(DbType="NChar(1)")] System.Nullable<char> albumLetter)
		{
			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), albumLetter);
			return ((int)(result.ReturnValue));
		}
		
		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.GetArtistsByLetter")]
		public int GetArtistsByLetter([global::System.Data.Linq.Mapping.ParameterAttribute(DbType="NChar(1)")] System.Nullable<char> letter)
		{
			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), letter);
			return ((int)(result.ReturnValue));
		}
		
		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.GetArtistsByGenre")]
		public int GetArtistsByGenre([global::System.Data.Linq.Mapping.ParameterAttribute(DbType="NVarChar(MAX)")] string genre)
		{
			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), genre);
			return ((int)(result.ReturnValue));
		}
		
		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.GetArtistsBySongLetter")]
		public int GetArtistsBySongLetter([global::System.Data.Linq.Mapping.ParameterAttribute(DbType="NChar(1)")] System.Nullable<char> songLetter)
		{
			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), songLetter);
			return ((int)(result.ReturnValue));
		}
		
		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.GetSongsByAlbumLetter")]
		public int GetSongsByAlbumLetter([global::System.Data.Linq.Mapping.ParameterAttribute(DbType="NChar(1)")] System.Nullable<char> albumLetter)
		{
			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), albumLetter);
			return ((int)(result.ReturnValue));
		}
		
		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.GetSongsByArtistLetter")]
		public int GetSongsByArtistLetter([global::System.Data.Linq.Mapping.ParameterAttribute(DbType="NChar(1)")] System.Nullable<char> artistLetter)
		{
			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), artistLetter);
			return ((int)(result.ReturnValue));
		}
		
		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.GetSongsByLetter")]
		public int GetSongsByLetter([global::System.Data.Linq.Mapping.ParameterAttribute(DbType="NChar(1)")] System.Nullable<char> letter)
		{
			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), letter);
			return ((int)(result.ReturnValue));
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.artist")]
	public partial class Artist : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _ArtistID;
		
		private string _Artist;
		
		private System.Data.Linq.Binary _changed;
		
		private EntitySet<Album> _albums1;
		
		private EntitySet<Song> _songs1;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnArtistIDChanging(int value);
    partial void OnArtistIDChanged();
    partial void OnArtistNameChanging(string value);
    partial void OnArtistNameChanged();
    partial void OnchangedChanging(System.Data.Linq.Binary value);
    partial void OnchangedChanged();
    #endregion
		
		public Artist()
		{
			this._albums1 = new EntitySet<Album>(new Action<Album>(this.attach_albums1), new Action<Album>(this.detach_albums1));
			this._songs1 = new EntitySet<Song>(new Action<Song>(this.attach_songs1), new Action<Song>(this.detach_songs1));
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="artist_id", Storage="_ArtistID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)]
		public int ArtistID
		{
			get
			{
				return this._ArtistID;
			}
			set
			{
				if ((this._ArtistID != value))
				{
					this.OnArtistIDChanging(value);
					this.SendPropertyChanging();
					this._ArtistID = value;
					this.SendPropertyChanged("ArtistID");
					this.OnArtistIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="artist", Storage="_Artist", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
		public string ArtistName
		{
			get
			{
				return this._Artist;
			}
			set
			{
				if ((this._Artist != value))
				{
					this.OnArtistNameChanging(value);
					this.SendPropertyChanging();
					this._Artist = value;
					this.SendPropertyChanged("ArtistName");
					this.OnArtistNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_changed", AutoSync=AutoSync.Always, DbType="rowversion NOT NULL", CanBeNull=false, IsDbGenerated=true, IsVersion=true, UpdateCheck=UpdateCheck.Never)]
		public System.Data.Linq.Binary changed
		{
			get
			{
				return this._changed;
			}
			set
			{
				if ((this._changed != value))
				{
					this.OnchangedChanging(value);
					this.SendPropertyChanging();
					this._changed = value;
					this.SendPropertyChanged("changed");
					this.OnchangedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Artists_Albums", Storage="_albums1", ThisKey="ArtistID", OtherKey="ArtistID")]
		public EntitySet<Album> albums1
		{
			get
			{
				return this._albums1;
			}
			set
			{
				this._albums1.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Artists_Songs", Storage="_songs1", ThisKey="ArtistID", OtherKey="ArtistID")]
		public EntitySet<Song> songs1
		{
			get
			{
				return this._songs1;
			}
			set
			{
				this._songs1.Assign(value);
			}
		}
		
		public event PropertyChangingEventHandler PropertyChanging;
		
		public event PropertyChangedEventHandler PropertyChanged;
		
		protected virtual void SendPropertyChanging()
		{
			if ((this.PropertyChanging != null))
			{
				this.PropertyChanging(this, emptyChangingEventArgs);
			}
		}
		
		protected virtual void SendPropertyChanged(String propertyName)
		{
			if ((this.PropertyChanged != null))
			{
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
		
		private void attach_albums1(Album entity)
		{
			this.SendPropertyChanging();
			entity.Artist = this;
		}
		
		private void detach_albums1(Album entity)
		{
			this.SendPropertyChanging();
			entity.Artist = null;
		}
		
		private void attach_songs1(Song entity)
		{
			this.SendPropertyChanging();
			entity.Artist = this;
		}
		
		private void detach_songs1(Song entity)
		{
			this.SendPropertyChanging();
			entity.Artist = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.album")]
	public partial class Album : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _AlbumID;
		
		private int _ArtistID;
		
		private string _Album;
		
		private System.Data.Linq.Binary _changed;
		
		private EntitySet<Song> _songs1;
		
		private EntityRef<Artist> _Artists;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnAlbumIDChanging(int value);
    partial void OnAlbumIDChanged();
    partial void OnArtistIDChanging(int value);
    partial void OnArtistIDChanged();
    partial void OnAlbumNameChanging(string value);
    partial void OnAlbumNameChanged();
    partial void OnchangedChanging(System.Data.Linq.Binary value);
    partial void OnchangedChanged();
    #endregion
		
		public Album()
		{
			this._songs1 = new EntitySet<Song>(new Action<Song>(this.attach_songs1), new Action<Song>(this.detach_songs1));
			this._Artists = default(EntityRef<Artist>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="album_id", Storage="_AlbumID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)]
		public int AlbumID
		{
			get
			{
				return this._AlbumID;
			}
			set
			{
				if ((this._AlbumID != value))
				{
					this.OnAlbumIDChanging(value);
					this.SendPropertyChanging();
					this._AlbumID = value;
					this.SendPropertyChanged("AlbumID");
					this.OnAlbumIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="artist_id", Storage="_ArtistID", DbType="Int NOT NULL", UpdateCheck=UpdateCheck.Never)]
		public int ArtistID
		{
			get
			{
				return this._ArtistID;
			}
			set
			{
				if ((this._ArtistID != value))
				{
					this.OnArtistIDChanging(value);
					this.SendPropertyChanging();
					this._ArtistID = value;
					this.SendPropertyChanged("ArtistID");
					this.OnArtistIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="album", Storage="_Album", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
		public string AlbumName
		{
			get
			{
				return this._Album;
			}
			set
			{
				if ((this._Album != value))
				{
					this.OnAlbumNameChanging(value);
					this.SendPropertyChanging();
					this._Album = value;
					this.SendPropertyChanged("AlbumName");
					this.OnAlbumNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_changed", AutoSync=AutoSync.Always, DbType="rowversion NOT NULL", CanBeNull=false, IsDbGenerated=true, IsVersion=true, UpdateCheck=UpdateCheck.Never)]
		public System.Data.Linq.Binary changed
		{
			get
			{
				return this._changed;
			}
			set
			{
				if ((this._changed != value))
				{
					this.OnchangedChanging(value);
					this.SendPropertyChanging();
					this._changed = value;
					this.SendPropertyChanged("changed");
					this.OnchangedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Albums_Songs", Storage="_songs1", ThisKey="AlbumID", OtherKey="AlbumID")]
		public EntitySet<Song> songs1
		{
			get
			{
				return this._songs1;
			}
			set
			{
				this._songs1.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Artists_Albums", Storage="_Artists", ThisKey="ArtistID", OtherKey="ArtistID", IsForeignKey=true)]
		public Artist Artist
		{
			get
			{
				return this._Artists.Entity;
			}
			set
			{
				Artist previousValue = this._Artists.Entity;
				if (((previousValue != value) 
							|| (this._Artists.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Artists.Entity = null;
						previousValue.albums1.Remove(this);
					}
					this._Artists.Entity = value;
					if ((value != null))
					{
						value.albums1.Add(this);
						this._ArtistID = value.ArtistID;
					}
					else
					{
						this._ArtistID = default(int);
					}
					this.SendPropertyChanged("Artist");
				}
			}
		}
		
		public event PropertyChangingEventHandler PropertyChanging;
		
		public event PropertyChangedEventHandler PropertyChanged;
		
		protected virtual void SendPropertyChanging()
		{
			if ((this.PropertyChanging != null))
			{
				this.PropertyChanging(this, emptyChangingEventArgs);
			}
		}
		
		protected virtual void SendPropertyChanged(String propertyName)
		{
			if ((this.PropertyChanged != null))
			{
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
		
		private void attach_songs1(Song entity)
		{
			this.SendPropertyChanging();
			entity.Album = this;
		}
		
		private void detach_songs1(Song entity)
		{
			this.SendPropertyChanging();
			entity.Album = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.song")]
	public partial class Song : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _SongID;
		
		private int _ArtistID;
		
		private int _AlbumID;
		
		private string _Title;
		
		private string _URL;
		
		private string _Genre;
		
		private string _Track;
		
		private string _Length;
		
		private System.DateTime _Added;
		
		private System.Nullable<System.DateTime> _Modified;
		
		private System.Data.Linq.Binary _changed;
		
		private EntitySet<PlaylistItem> _PlaylistItems;
		
		private EntityRef<Album> _Albums;
		
		private EntityRef<Artist> _Artists;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnSongIDChanging(int value);
    partial void OnSongIDChanged();
    partial void OnArtistIDChanging(int value);
    partial void OnArtistIDChanged();
    partial void OnAlbumIDChanging(int value);
    partial void OnAlbumIDChanged();
    partial void OnTitleChanging(string value);
    partial void OnTitleChanged();
    partial void OnURLChanging(string value);
    partial void OnURLChanged();
    partial void OnGenreChanging(string value);
    partial void OnGenreChanged();
    partial void OnTrackChanging(string value);
    partial void OnTrackChanged();
    partial void OnLengthChanging(string value);
    partial void OnLengthChanged();
    partial void OnAddedChanging(System.DateTime value);
    partial void OnAddedChanged();
    partial void OnModifiedChanging(System.Nullable<System.DateTime> value);
    partial void OnModifiedChanged();
    partial void OnchangedChanging(System.Data.Linq.Binary value);
    partial void OnchangedChanged();
    #endregion
		
		public Song()
		{
			this._PlaylistItems = new EntitySet<PlaylistItem>(new Action<PlaylistItem>(this.attach_PlaylistItems), new Action<PlaylistItem>(this.detach_PlaylistItems));
			this._Albums = default(EntityRef<Album>);
			this._Artists = default(EntityRef<Artist>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="song_id", Storage="_SongID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)]
		public int SongID
		{
			get
			{
				return this._SongID;
			}
			set
			{
				if ((this._SongID != value))
				{
					this.OnSongIDChanging(value);
					this.SendPropertyChanging();
					this._SongID = value;
					this.SendPropertyChanged("SongID");
					this.OnSongIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="artist_id", Storage="_ArtistID", DbType="Int NOT NULL", UpdateCheck=UpdateCheck.Never)]
		public int ArtistID
		{
			get
			{
				return this._ArtistID;
			}
			set
			{
				if ((this._ArtistID != value))
				{
					this.OnArtistIDChanging(value);
					this.SendPropertyChanging();
					this._ArtistID = value;
					this.SendPropertyChanged("ArtistID");
					this.OnArtistIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="album_id", Storage="_AlbumID", DbType="Int NOT NULL", UpdateCheck=UpdateCheck.Never)]
		public int AlbumID
		{
			get
			{
				return this._AlbumID;
			}
			set
			{
				if ((this._AlbumID != value))
				{
					this.OnAlbumIDChanging(value);
					this.SendPropertyChanging();
					this._AlbumID = value;
					this.SendPropertyChanged("AlbumID");
					this.OnAlbumIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="title", Storage="_Title", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
		public string Title
		{
			get
			{
				return this._Title;
			}
			set
			{
				if ((this._Title != value))
				{
					this.OnTitleChanging(value);
					this.SendPropertyChanging();
					this._Title = value;
					this.SendPropertyChanged("Title");
					this.OnTitleChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="url", Storage="_URL", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
		public string URL
		{
			get
			{
				return this._URL;
			}
			set
			{
				if ((this._URL != value))
				{
					this.OnURLChanging(value);
					this.SendPropertyChanging();
					this._URL = value;
					this.SendPropertyChanged("URL");
					this.OnURLChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="genre", Storage="_Genre", DbType="NVarChar(40)", UpdateCheck=UpdateCheck.Never)]
		public string Genre
		{
			get
			{
				return this._Genre;
			}
			set
			{
				if ((this._Genre != value))
				{
					this.OnGenreChanging(value);
					this.SendPropertyChanging();
					this._Genre = value;
					this.SendPropertyChanged("Genre");
					this.OnGenreChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="track", Storage="_Track", DbType="NVarChar(10)", UpdateCheck=UpdateCheck.Never)]
		public string Track
		{
			get
			{
				return this._Track;
			}
			set
			{
				if ((this._Track != value))
				{
					this.OnTrackChanging(value);
					this.SendPropertyChanging();
					this._Track = value;
					this.SendPropertyChanged("Track");
					this.OnTrackChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="length", Storage="_Length", DbType="NVarChar(10)", UpdateCheck=UpdateCheck.Never)]
		public string Length
		{
			get
			{
				return this._Length;
			}
			set
			{
				if ((this._Length != value))
				{
					this.OnLengthChanging(value);
					this.SendPropertyChanging();
					this._Length = value;
					this.SendPropertyChanged("Length");
					this.OnLengthChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="added", Storage="_Added", DbType="DateTime NOT NULL", UpdateCheck=UpdateCheck.Never)]
		public System.DateTime Added
		{
			get
			{
				return this._Added;
			}
			set
			{
				if ((this._Added != value))
				{
					this.OnAddedChanging(value);
					this.SendPropertyChanging();
					this._Added = value;
					this.SendPropertyChanged("Added");
					this.OnAddedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="modified", Storage="_Modified", DbType="DateTime", UpdateCheck=UpdateCheck.Never)]
		public System.Nullable<System.DateTime> Modified
		{
			get
			{
				return this._Modified;
			}
			set
			{
				if ((this._Modified != value))
				{
					this.OnModifiedChanging(value);
					this.SendPropertyChanging();
					this._Modified = value;
					this.SendPropertyChanged("Modified");
					this.OnModifiedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_changed", AutoSync=AutoSync.Always, DbType="rowversion NOT NULL", CanBeNull=false, IsDbGenerated=true, IsVersion=true, UpdateCheck=UpdateCheck.Never)]
		public System.Data.Linq.Binary changed
		{
			get
			{
				return this._changed;
			}
			set
			{
				if ((this._changed != value))
				{
					this.OnchangedChanging(value);
					this.SendPropertyChanging();
					this._changed = value;
					this.SendPropertyChanged("changed");
					this.OnchangedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Songs_PlaylistItems", Storage="_PlaylistItems", ThisKey="SongID", OtherKey="SongID")]
		public EntitySet<PlaylistItem> PlaylistItems
		{
			get
			{
				return this._PlaylistItems;
			}
			set
			{
				this._PlaylistItems.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Albums_Songs", Storage="_Albums", ThisKey="AlbumID", OtherKey="AlbumID", IsForeignKey=true)]
		public Album Album
		{
			get
			{
				return this._Albums.Entity;
			}
			set
			{
				Album previousValue = this._Albums.Entity;
				if (((previousValue != value) 
							|| (this._Albums.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Albums.Entity = null;
						previousValue.songs1.Remove(this);
					}
					this._Albums.Entity = value;
					if ((value != null))
					{
						value.songs1.Add(this);
						this._AlbumID = value.AlbumID;
					}
					else
					{
						this._AlbumID = default(int);
					}
					this.SendPropertyChanged("Album");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Artists_Songs", Storage="_Artists", ThisKey="ArtistID", OtherKey="ArtistID", IsForeignKey=true)]
		public Artist Artist
		{
			get
			{
				return this._Artists.Entity;
			}
			set
			{
				Artist previousValue = this._Artists.Entity;
				if (((previousValue != value) 
							|| (this._Artists.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Artists.Entity = null;
						previousValue.songs1.Remove(this);
					}
					this._Artists.Entity = value;
					if ((value != null))
					{
						value.songs1.Add(this);
						this._ArtistID = value.ArtistID;
					}
					else
					{
						this._ArtistID = default(int);
					}
					this.SendPropertyChanged("Artist");
				}
			}
		}
		
		public event PropertyChangingEventHandler PropertyChanging;
		
		public event PropertyChangedEventHandler PropertyChanged;
		
		protected virtual void SendPropertyChanging()
		{
			if ((this.PropertyChanging != null))
			{
				this.PropertyChanging(this, emptyChangingEventArgs);
			}
		}
		
		protected virtual void SendPropertyChanged(String propertyName)
		{
			if ((this.PropertyChanged != null))
			{
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
		
		private void attach_PlaylistItems(PlaylistItem entity)
		{
			this.SendPropertyChanging();
			entity.Song = this;
		}
		
		private void detach_PlaylistItems(PlaylistItem entity)
		{
			this.SendPropertyChanging();
			entity.Song = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.playlist_item")]
	public partial class PlaylistItem : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _PlaylistItemID;
		
		private int _PlaylistID;
		
		private int _SongID;
		
		private System.Data.Linq.Binary _changed;
		
		private EntityRef<Song> _Songs;
		
		private EntityRef<Playlist> _Playlists;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnPlaylistItemIDChanging(int value);
    partial void OnPlaylistItemIDChanged();
    partial void OnPlaylistIDChanging(int value);
    partial void OnPlaylistIDChanged();
    partial void OnSongIDChanging(int value);
    partial void OnSongIDChanged();
    partial void OnchangedChanging(System.Data.Linq.Binary value);
    partial void OnchangedChanged();
    #endregion
		
		public PlaylistItem()
		{
			this._Songs = default(EntityRef<Song>);
			this._Playlists = default(EntityRef<Playlist>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="playlist_item_id", Storage="_PlaylistItemID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)]
		public int PlaylistItemID
		{
			get
			{
				return this._PlaylistItemID;
			}
			set
			{
				if ((this._PlaylistItemID != value))
				{
					this.OnPlaylistItemIDChanging(value);
					this.SendPropertyChanging();
					this._PlaylistItemID = value;
					this.SendPropertyChanged("PlaylistItemID");
					this.OnPlaylistItemIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="playlist_id", Storage="_PlaylistID", DbType="Int NOT NULL", UpdateCheck=UpdateCheck.Never)]
		public int PlaylistID
		{
			get
			{
				return this._PlaylistID;
			}
			set
			{
				if ((this._PlaylistID != value))
				{
					this.OnPlaylistIDChanging(value);
					this.SendPropertyChanging();
					this._PlaylistID = value;
					this.SendPropertyChanged("PlaylistID");
					this.OnPlaylistIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="song_id", Storage="_SongID", DbType="Int NOT NULL", UpdateCheck=UpdateCheck.Never)]
		public int SongID
		{
			get
			{
				return this._SongID;
			}
			set
			{
				if ((this._SongID != value))
				{
					this.OnSongIDChanging(value);
					this.SendPropertyChanging();
					this._SongID = value;
					this.SendPropertyChanged("SongID");
					this.OnSongIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_changed", AutoSync=AutoSync.Always, DbType="rowversion NOT NULL", CanBeNull=false, IsDbGenerated=true, IsVersion=true, UpdateCheck=UpdateCheck.Never)]
		public System.Data.Linq.Binary changed
		{
			get
			{
				return this._changed;
			}
			set
			{
				if ((this._changed != value))
				{
					this.OnchangedChanging(value);
					this.SendPropertyChanging();
					this._changed = value;
					this.SendPropertyChanged("changed");
					this.OnchangedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Songs_PlaylistItems", Storage="_Songs", ThisKey="SongID", OtherKey="SongID", IsForeignKey=true)]
		public Song Song
		{
			get
			{
				return this._Songs.Entity;
			}
			set
			{
				Song previousValue = this._Songs.Entity;
				if (((previousValue != value) 
							|| (this._Songs.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Songs.Entity = null;
						previousValue.PlaylistItems.Remove(this);
					}
					this._Songs.Entity = value;
					if ((value != null))
					{
						value.PlaylistItems.Add(this);
						this._SongID = value.SongID;
					}
					else
					{
						this._SongID = default(int);
					}
					this.SendPropertyChanged("Song");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Playlists_PlaylistItems", Storage="_Playlists", ThisKey="PlaylistID", OtherKey="PlaylistID", IsForeignKey=true)]
		public Playlist Playlist
		{
			get
			{
				return this._Playlists.Entity;
			}
			set
			{
				Playlist previousValue = this._Playlists.Entity;
				if (((previousValue != value) 
							|| (this._Playlists.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Playlists.Entity = null;
						previousValue.PlaylistItems.Remove(this);
					}
					this._Playlists.Entity = value;
					if ((value != null))
					{
						value.PlaylistItems.Add(this);
						this._PlaylistID = value.PlaylistID;
					}
					else
					{
						this._PlaylistID = default(int);
					}
					this.SendPropertyChanged("Playlist");
				}
			}
		}
		
		public event PropertyChangingEventHandler PropertyChanging;
		
		public event PropertyChangedEventHandler PropertyChanged;
		
		protected virtual void SendPropertyChanging()
		{
			if ((this.PropertyChanging != null))
			{
				this.PropertyChanging(this, emptyChangingEventArgs);
			}
		}
		
		protected virtual void SendPropertyChanged(String propertyName)
		{
			if ((this.PropertyChanged != null))
			{
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.playlist")]
	public partial class Playlist : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _PlaylistID;
		
		private string _UserName;
		
		private string _Name;
		
		private System.Data.Linq.Binary _changed;
		
		private EntitySet<PlaylistItem> _PlaylistItems;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnPlaylistIDChanging(int value);
    partial void OnPlaylistIDChanged();
    partial void OnUserNameChanging(string value);
    partial void OnUserNameChanged();
    partial void OnNameChanging(string value);
    partial void OnNameChanged();
    partial void OnchangedChanging(System.Data.Linq.Binary value);
    partial void OnchangedChanged();
    #endregion
		
		public Playlist()
		{
			this._PlaylistItems = new EntitySet<PlaylistItem>(new Action<PlaylistItem>(this.attach_PlaylistItems), new Action<PlaylistItem>(this.detach_PlaylistItems));
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="playlist_id", Storage="_PlaylistID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)]
		public int PlaylistID
		{
			get
			{
				return this._PlaylistID;
			}
			set
			{
				if ((this._PlaylistID != value))
				{
					this.OnPlaylistIDChanging(value);
					this.SendPropertyChanging();
					this._PlaylistID = value;
					this.SendPropertyChanged("PlaylistID");
					this.OnPlaylistIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="username", Storage="_UserName", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
		public string UserName
		{
			get
			{
				return this._UserName;
			}
			set
			{
				if ((this._UserName != value))
				{
					this.OnUserNameChanging(value);
					this.SendPropertyChanging();
					this._UserName = value;
					this.SendPropertyChanged("UserName");
					this.OnUserNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="title", Storage="_Name", DbType="NVarChar(80) NOT NULL", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
		public string Name
		{
			get
			{
				return this._Name;
			}
			set
			{
				if ((this._Name != value))
				{
					this.OnNameChanging(value);
					this.SendPropertyChanging();
					this._Name = value;
					this.SendPropertyChanged("Name");
					this.OnNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_changed", AutoSync=AutoSync.Always, DbType="rowversion NOT NULL", CanBeNull=false, IsDbGenerated=true, IsVersion=true, UpdateCheck=UpdateCheck.Never)]
		public System.Data.Linq.Binary changed
		{
			get
			{
				return this._changed;
			}
			set
			{
				if ((this._changed != value))
				{
					this.OnchangedChanging(value);
					this.SendPropertyChanging();
					this._changed = value;
					this.SendPropertyChanged("changed");
					this.OnchangedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Playlists_PlaylistItems", Storage="_PlaylistItems", ThisKey="PlaylistID", OtherKey="PlaylistID")]
		public EntitySet<PlaylistItem> PlaylistItems
		{
			get
			{
				return this._PlaylistItems;
			}
			set
			{
				this._PlaylistItems.Assign(value);
			}
		}
		
		public event PropertyChangingEventHandler PropertyChanging;
		
		public event PropertyChangedEventHandler PropertyChanged;
		
		protected virtual void SendPropertyChanging()
		{
			if ((this.PropertyChanging != null))
			{
				this.PropertyChanging(this, emptyChangingEventArgs);
			}
		}
		
		protected virtual void SendPropertyChanged(String propertyName)
		{
			if ((this.PropertyChanged != null))
			{
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
		
		private void attach_PlaylistItems(PlaylistItem entity)
		{
			this.SendPropertyChanging();
			entity.Playlist = this;
		}
		
		private void detach_PlaylistItems(PlaylistItem entity)
		{
			this.SendPropertyChanging();
			entity.Playlist = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Songs")]
	public partial class SongView
	{
		
		private string _Artist;
		
		private string _Album;
		
		private string _Title;
		
		private string _URL;
		
		private string _Genre;
		
		private string _Track;
		
		private string _Length;
		
		private int _ArtistID;
		
		private int _AlbumID;
		
		private int _SongID;
		
		public SongView()
		{
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="artist", Storage="_Artist", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false)]
		public string Artist
		{
			get
			{
				return this._Artist;
			}
			set
			{
				if ((this._Artist != value))
				{
					this._Artist = value;
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="album", Storage="_Album", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false)]
		public string Album
		{
			get
			{
				return this._Album;
			}
			set
			{
				if ((this._Album != value))
				{
					this._Album = value;
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="title", Storage="_Title", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false)]
		public string Title
		{
			get
			{
				return this._Title;
			}
			set
			{
				if ((this._Title != value))
				{
					this._Title = value;
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="url", Storage="_URL", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false)]
		public string URL
		{
			get
			{
				return this._URL;
			}
			set
			{
				if ((this._URL != value))
				{
					this._URL = value;
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="genre", Storage="_Genre", DbType="NVarChar(40)")]
		public string Genre
		{
			get
			{
				return this._Genre;
			}
			set
			{
				if ((this._Genre != value))
				{
					this._Genre = value;
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="track", Storage="_Track", DbType="NVarChar(10)")]
		public string Track
		{
			get
			{
				return this._Track;
			}
			set
			{
				if ((this._Track != value))
				{
					this._Track = value;
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="length", Storage="_Length", DbType="NVarChar(10)")]
		public string Length
		{
			get
			{
				return this._Length;
			}
			set
			{
				if ((this._Length != value))
				{
					this._Length = value;
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="artist_id", Storage="_ArtistID", DbType="Int NOT NULL")]
		public int ArtistID
		{
			get
			{
				return this._ArtistID;
			}
			set
			{
				if ((this._ArtistID != value))
				{
					this._ArtistID = value;
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="album_id", Storage="_AlbumID", DbType="Int NOT NULL")]
		public int AlbumID
		{
			get
			{
				return this._AlbumID;
			}
			set
			{
				if ((this._AlbumID != value))
				{
					this._AlbumID = value;
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="song_id", Storage="_SongID", DbType="Int NOT NULL")]
		public int SongID
		{
			get
			{
				return this._SongID;
			}
			set
			{
				if ((this._SongID != value))
				{
					this._SongID = value;
				}
			}
		}
	}
	
	public partial class GetArtistLetterIndexResult
	{
		
		private string _ArtistLetter;
		
		private System.Nullable<int> _Num;
		
		public GetArtistLetterIndexResult()
		{
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ArtistLetter", DbType="NVarChar(MAX)")]
		public string ArtistLetter
		{
			get
			{
				return this._ArtistLetter;
			}
			set
			{
				if ((this._ArtistLetter != value))
				{
					this._ArtistLetter = value;
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Num", DbType="Int")]
		public System.Nullable<int> Num
		{
			get
			{
				return this._Num;
			}
			set
			{
				if ((this._Num != value))
				{
					this._Num = value;
				}
			}
		}
	}
	
	public partial class GetAlbumLetterIndexResult
	{
		
		private string _AlbumLetter;
		
		private System.Nullable<int> _Num;
		
		public GetAlbumLetterIndexResult()
		{
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AlbumLetter", DbType="NVarChar(MAX)")]
		public string AlbumLetter
		{
			get
			{
				return this._AlbumLetter;
			}
			set
			{
				if ((this._AlbumLetter != value))
				{
					this._AlbumLetter = value;
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Num", DbType="Int")]
		public System.Nullable<int> Num
		{
			get
			{
				return this._Num;
			}
			set
			{
				if ((this._Num != value))
				{
					this._Num = value;
				}
			}
		}
	}
	
	public partial class GetSongLetterIndexResult
	{
		
		private string _SongLetter;
		
		private System.Nullable<int> _Num;
		
		public GetSongLetterIndexResult()
		{
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SongLetter", DbType="NVarChar(MAX)")]
		public string SongLetter
		{
			get
			{
				return this._SongLetter;
			}
			set
			{
				if ((this._SongLetter != value))
				{
					this._SongLetter = value;
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Num", DbType="Int")]
		public System.Nullable<int> Num
		{
			get
			{
				return this._Num;
			}
			set
			{
				if ((this._Num != value))
				{
					this._Num = value;
				}
			}
		}
	}
}
#pragma warning restore 1591
