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

Option Strict On
Option Explicit On

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Data.Linq
Imports System.Data.Linq.Mapping
Imports System.Linq
Imports System.Linq.Expressions
Imports System.Reflection


<Global.System.Data.Linq.Mapping.DatabaseAttribute(Name:="NORTHWND")> _
Partial Public Class NorthwindDataContext
    Inherits System.Data.Linq.DataContext

    Private Shared mappingSource As System.Data.Linq.Mapping.MappingSource = New AttributeMappingSource()

#Region "Extensibility Method Definitions"
    Partial Private Sub OnCreated()
    End Sub
    Partial Private Sub InsertCategory(ByVal instance As Category)
    End Sub
    Partial Private Sub UpdateCategory(ByVal instance As Category)
    End Sub
    Partial Private Sub DeleteCategory(ByVal instance As Category)
    End Sub
    Partial Private Sub InsertTerritory(ByVal instance As Territory)
    End Sub
    Partial Private Sub UpdateTerritory(ByVal instance As Territory)
    End Sub
    Partial Private Sub DeleteTerritory(ByVal instance As Territory)
    End Sub
    Partial Private Sub InsertCustomerCustomerDemo(ByVal instance As CustomerCustomerDemo)
    End Sub
    Partial Private Sub UpdateCustomerCustomerDemo(ByVal instance As CustomerCustomerDemo)
    End Sub
    Partial Private Sub DeleteCustomerCustomerDemo(ByVal instance As CustomerCustomerDemo)
    End Sub
    Partial Private Sub InsertCustomerDemographic(ByVal instance As CustomerDemographic)
    End Sub
    Partial Private Sub UpdateCustomerDemographic(ByVal instance As CustomerDemographic)
    End Sub
    Partial Private Sub DeleteCustomerDemographic(ByVal instance As CustomerDemographic)
    End Sub
    Partial Private Sub InsertCustomer(ByVal instance As Customer)
    End Sub
    Partial Private Sub UpdateCustomer(ByVal instance As Customer)
    End Sub
    Partial Private Sub DeleteCustomer(ByVal instance As Customer)
    End Sub
    Partial Private Sub InsertEmployee(ByVal instance As Employee)
    End Sub
    Partial Private Sub UpdateEmployee(ByVal instance As Employee)
    End Sub
    Partial Private Sub DeleteEmployee(ByVal instance As Employee)
    End Sub
    Partial Private Sub InsertEmployeeTerritory(ByVal instance As EmployeeTerritory)
    End Sub
    Partial Private Sub UpdateEmployeeTerritory(ByVal instance As EmployeeTerritory)
    End Sub
    Partial Private Sub DeleteEmployeeTerritory(ByVal instance As EmployeeTerritory)
    End Sub
    Partial Private Sub InsertOrder_Detail(ByVal instance As Order_Detail)
    End Sub
    Partial Private Sub UpdateOrder_Detail(ByVal instance As Order_Detail)
    End Sub
    Partial Private Sub DeleteOrder_Detail(ByVal instance As Order_Detail)
    End Sub
    Partial Private Sub InsertOrder(ByVal instance As [Order])
    End Sub
    Partial Private Sub UpdateOrder(ByVal instance As [Order])
    End Sub
    Partial Private Sub DeleteOrder(ByVal instance As [Order])
    End Sub
    Partial Private Sub InsertProduct(ByVal instance As Product)
    End Sub
    Partial Private Sub UpdateProduct(ByVal instance As Product)
    End Sub
    Partial Private Sub DeleteProduct(ByVal instance As Product)
    End Sub
    Partial Private Sub InsertRegion(ByVal instance As Region)
    End Sub
    Partial Private Sub UpdateRegion(ByVal instance As Region)
    End Sub
    Partial Private Sub DeleteRegion(ByVal instance As Region)
    End Sub
    Partial Private Sub InsertShipper(ByVal instance As Shipper)
    End Sub
    Partial Private Sub UpdateShipper(ByVal instance As Shipper)
    End Sub
    Partial Private Sub DeleteShipper(ByVal instance As Shipper)
    End Sub
    Partial Private Sub InsertSupplier(ByVal instance As Supplier)
    End Sub
    Partial Private Sub UpdateSupplier(ByVal instance As Supplier)
    End Sub
    Partial Private Sub DeleteSupplier(ByVal instance As Supplier)
    End Sub
#End Region

    Public Sub New()
        MyBase.New(Global.System.Configuration.ConfigurationManager.ConnectionStrings("NORTHWNDConnectionString").ConnectionString, mappingSource)
        OnCreated()
    End Sub

    Public Sub New(ByVal connection As String)
        MyBase.New(connection, mappingSource)
        OnCreated()
    End Sub

    Public Sub New(ByVal connection As System.Data.IDbConnection)
        MyBase.New(connection, mappingSource)
        OnCreated()
    End Sub

    Public Sub New(ByVal connection As String, ByVal mappingSource As System.Data.Linq.Mapping.MappingSource)
        MyBase.New(connection, mappingSource)
        OnCreated()
    End Sub

    Public Sub New(ByVal connection As System.Data.IDbConnection, ByVal mappingSource As System.Data.Linq.Mapping.MappingSource)
        MyBase.New(connection, mappingSource)
        OnCreated()
    End Sub

    Public ReadOnly Property Categories() As System.Data.Linq.Table(Of Category)
        Get
            Return Me.GetTable(Of Category)()
        End Get
    End Property

    Public ReadOnly Property Territories() As System.Data.Linq.Table(Of Territory)
        Get
            Return Me.GetTable(Of Territory)()
        End Get
    End Property

    Public ReadOnly Property CustomerCustomerDemos() As System.Data.Linq.Table(Of CustomerCustomerDemo)
        Get
            Return Me.GetTable(Of CustomerCustomerDemo)()
        End Get
    End Property

    Public ReadOnly Property CustomerDemographics() As System.Data.Linq.Table(Of CustomerDemographic)
        Get
            Return Me.GetTable(Of CustomerDemographic)()
        End Get
    End Property

    Public ReadOnly Property Customers() As System.Data.Linq.Table(Of Customer)
        Get
            Return Me.GetTable(Of Customer)()
        End Get
    End Property

    Public ReadOnly Property Employees() As System.Data.Linq.Table(Of Employee)
        Get
            Return Me.GetTable(Of Employee)()
        End Get
    End Property

    Public ReadOnly Property EmployeeTerritories() As System.Data.Linq.Table(Of EmployeeTerritory)
        Get
            Return Me.GetTable(Of EmployeeTerritory)()
        End Get
    End Property

    Public ReadOnly Property Order_Details() As System.Data.Linq.Table(Of Order_Detail)
        Get
            Return Me.GetTable(Of Order_Detail)()
        End Get
    End Property

    Public ReadOnly Property Orders() As System.Data.Linq.Table(Of [Order])
        Get
            Return Me.GetTable(Of [Order])()
        End Get
    End Property

    Public ReadOnly Property Products() As System.Data.Linq.Table(Of Product)
        Get
            Return Me.GetTable(Of Product)()
        End Get
    End Property

    Public ReadOnly Property Regions() As System.Data.Linq.Table(Of Region)
        Get
            Return Me.GetTable(Of Region)()
        End Get
    End Property

    Public ReadOnly Property Shippers() As System.Data.Linq.Table(Of Shipper)
        Get
            Return Me.GetTable(Of Shipper)()
        End Get
    End Property

    Public ReadOnly Property Suppliers() As System.Data.Linq.Table(Of Supplier)
        Get
            Return Me.GetTable(Of Supplier)()
        End Get
    End Property
End Class

<Global.System.Data.Linq.Mapping.TableAttribute(Name:="dbo.Categories")> _
Partial Public Class Category
    Implements System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged

    Private Shared emptyChangingEventArgs As PropertyChangingEventArgs = New PropertyChangingEventArgs(String.Empty)

    Private _CategoryID As Integer

    Private _CategoryName As String

    Private _Description As String

    Private _Picture As System.Data.Linq.Binary

    Private _Products As EntitySet(Of Product)

#Region "Extensibility Method Definitions"
    Partial Private Sub OnLoaded()
    End Sub
    Partial Private Sub OnValidate(ByVal action As System.Data.Linq.ChangeAction)
    End Sub
    Partial Private Sub OnCreated()
    End Sub
    Partial Private Sub OnCategoryIDChanging(ByVal value As Integer)
    End Sub
    Partial Private Sub OnCategoryIDChanged()
    End Sub
    Partial Private Sub OnCategoryNameChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnCategoryNameChanged()
    End Sub
    Partial Private Sub OnDescriptionChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnDescriptionChanged()
    End Sub
    Partial Private Sub OnPictureChanging(ByVal value As System.Data.Linq.Binary)
    End Sub
    Partial Private Sub OnPictureChanged()
    End Sub
#End Region

    Public Sub New()
        MyBase.New()
        Me._Products = New EntitySet(Of Product)(AddressOf Me.attach_Products, AddressOf Me.detach_Products)
        OnCreated()
    End Sub

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_CategoryID", AutoSync:=AutoSync.OnInsert, DbType:="Int NOT NULL IDENTITY", IsPrimaryKey:=True, IsDbGenerated:=True)> _
    Public Property CategoryID() As Integer
        Get
            Return Me._CategoryID
        End Get
        Set(ByVal value As Integer)
            If ((Me._CategoryID = value) _
               = False) Then
                Me.OnCategoryIDChanging(value)
                Me.SendPropertyChanging()
                Me._CategoryID = value
                Me.SendPropertyChanged("CategoryID")
                Me.OnCategoryIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_CategoryName", DbType:="NVarChar(15) NOT NULL", CanBeNull:=False)> _
    Public Property CategoryName() As String
        Get
            Return Me._CategoryName
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._CategoryName, value) = False) Then
                Me.OnCategoryNameChanging(value)
                Me.SendPropertyChanging()
                Me._CategoryName = value
                Me.SendPropertyChanged("CategoryName")
                Me.OnCategoryNameChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Description", DbType:="NText", UpdateCheck:=UpdateCheck.Never)> _
    Public Property Description() As String
        Get
            Return Me._Description
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._Description, value) = False) Then
                Me.OnDescriptionChanging(value)
                Me.SendPropertyChanging()
                Me._Description = value
                Me.SendPropertyChanged("Description")
                Me.OnDescriptionChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Picture", DbType:="Image", UpdateCheck:=UpdateCheck.Never)> _
    Public Property Picture() As System.Data.Linq.Binary
        Get
            Return Me._Picture
        End Get
        Set(ByVal value As System.Data.Linq.Binary)
            If (Object.Equals(Me._Picture, value) = False) Then
                Me.OnPictureChanging(value)
                Me.SendPropertyChanging()
                Me._Picture = value
                Me.SendPropertyChanged("Picture")
                Me.OnPictureChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Category_Product", Storage:="_Products", ThisKey:="CategoryID", OtherKey:="CategoryID")> _
    Public Property Products() As EntitySet(Of Product)
        Get
            Return Me._Products
        End Get
        Set(ByVal value As EntitySet(Of Product))
            Me._Products.Assign(value)
        End Set
    End Property

    Public Event PropertyChanging As PropertyChangingEventHandler Implements System.ComponentModel.INotifyPropertyChanging.PropertyChanging

    Public Event PropertyChanged As PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

    Protected Overridable Sub SendPropertyChanging()
        If ((Me.PropertyChangingEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanging(Me, emptyChangingEventArgs)
        End If
    End Sub

    Protected Overridable Sub SendPropertyChanged(ByVal propertyName As [String])
        If ((Me.PropertyChangedEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
        End If
    End Sub

    Private Sub attach_Products(ByVal entity As Product)
        Me.SendPropertyChanging()
        entity.Category = Me
    End Sub

    Private Sub detach_Products(ByVal entity As Product)
        Me.SendPropertyChanging()
        entity.Category = Nothing
    End Sub
End Class

<Global.System.Data.Linq.Mapping.TableAttribute(Name:="dbo.Territories")> _
Partial Public Class Territory
    Implements System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged

    Private Shared emptyChangingEventArgs As PropertyChangingEventArgs = New PropertyChangingEventArgs(String.Empty)

    Private _TerritoryID As String

    Private _TerritoryDescription As String

    Private _RegionID As Integer

    Private _EmployeeTerritories As EntitySet(Of EmployeeTerritory)

    Private _Region As EntityRef(Of Region)

#Region "Extensibility Method Definitions"
    Partial Private Sub OnLoaded()
    End Sub
    Partial Private Sub OnValidate(ByVal action As System.Data.Linq.ChangeAction)
    End Sub
    Partial Private Sub OnCreated()
    End Sub
    Partial Private Sub OnTerritoryIDChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnTerritoryIDChanged()
    End Sub
    Partial Private Sub OnTerritoryDescriptionChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnTerritoryDescriptionChanged()
    End Sub
    Partial Private Sub OnRegionIDChanging(ByVal value As Integer)
    End Sub
    Partial Private Sub OnRegionIDChanged()
    End Sub
#End Region

    Public Sub New()
        MyBase.New()
        Me._EmployeeTerritories = New EntitySet(Of EmployeeTerritory)(AddressOf Me.attach_EmployeeTerritories, AddressOf Me.detach_EmployeeTerritories)
        Me._Region = CType(Nothing, EntityRef(Of Region))
        OnCreated()
    End Sub

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_TerritoryID", DbType:="NVarChar(20) NOT NULL", CanBeNull:=False, IsPrimaryKey:=True)> _
    Public Property TerritoryID() As String
        Get
            Return Me._TerritoryID
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._TerritoryID, value) = False) Then
                Me.OnTerritoryIDChanging(value)
                Me.SendPropertyChanging()
                Me._TerritoryID = value
                Me.SendPropertyChanged("TerritoryID")
                Me.OnTerritoryIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_TerritoryDescription", DbType:="NChar(50) NOT NULL", CanBeNull:=False)> _
    Public Property TerritoryDescription() As String
        Get
            Return Me._TerritoryDescription
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._TerritoryDescription, value) = False) Then
                Me.OnTerritoryDescriptionChanging(value)
                Me.SendPropertyChanging()
                Me._TerritoryDescription = value
                Me.SendPropertyChanged("TerritoryDescription")
                Me.OnTerritoryDescriptionChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_RegionID", DbType:="Int NOT NULL")> _
    Public Property RegionID() As Integer
        Get
            Return Me._RegionID
        End Get
        Set(ByVal value As Integer)
            If ((Me._RegionID = value) _
               = False) Then
                If Me._Region.HasLoadedOrAssignedValue Then
                    Throw New System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException()
                End If
                Me.OnRegionIDChanging(value)
                Me.SendPropertyChanging()
                Me._RegionID = value
                Me.SendPropertyChanged("RegionID")
                Me.OnRegionIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Territory_EmployeeTerritory", Storage:="_EmployeeTerritories", ThisKey:="TerritoryID", OtherKey:="TerritoryID")> _
    Public Property EmployeeTerritories() As EntitySet(Of EmployeeTerritory)
        Get
            Return Me._EmployeeTerritories
        End Get
        Set(ByVal value As EntitySet(Of EmployeeTerritory))
            Me._EmployeeTerritories.Assign(value)
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Region_Territory", Storage:="_Region", ThisKey:="RegionID", OtherKey:="RegionID", IsForeignKey:=True)> _
    Public Property Region() As Region
        Get
            Return Me._Region.Entity
        End Get
        Set(ByVal value As Region)
            Dim previousValue As Region = Me._Region.Entity
            If ((Object.Equals(previousValue, value) = False) _
               OrElse (Me._Region.HasLoadedOrAssignedValue = False)) Then
                Me.SendPropertyChanging()
                If ((previousValue Is Nothing) _
                   = False) Then
                    Me._Region.Entity = Nothing
                    previousValue.Territories.Remove(Me)
                End If
                Me._Region.Entity = value
                If ((value Is Nothing) _
                   = False) Then
                    value.Territories.Add(Me)
                    Me._RegionID = value.RegionID
                Else
                    Me._RegionID = CType(Nothing, Integer)
                End If
                Me.SendPropertyChanged("Region")
            End If
        End Set
    End Property

    Public Event PropertyChanging As PropertyChangingEventHandler Implements System.ComponentModel.INotifyPropertyChanging.PropertyChanging

    Public Event PropertyChanged As PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

    Protected Overridable Sub SendPropertyChanging()
        If ((Me.PropertyChangingEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanging(Me, emptyChangingEventArgs)
        End If
    End Sub

    Protected Overridable Sub SendPropertyChanged(ByVal propertyName As [String])
        If ((Me.PropertyChangedEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
        End If
    End Sub

    Private Sub attach_EmployeeTerritories(ByVal entity As EmployeeTerritory)
        Me.SendPropertyChanging()
        entity.Territory = Me
    End Sub

    Private Sub detach_EmployeeTerritories(ByVal entity As EmployeeTerritory)
        Me.SendPropertyChanging()
        entity.Territory = Nothing
    End Sub
End Class

<Global.System.Data.Linq.Mapping.TableAttribute(Name:="dbo.CustomerCustomerDemo")> _
Partial Public Class CustomerCustomerDemo
    Implements System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged

    Private Shared emptyChangingEventArgs As PropertyChangingEventArgs = New PropertyChangingEventArgs(String.Empty)

    Private _CustomerID As String

    Private _CustomerTypeID As String

    Private _CustomerDemographic As EntityRef(Of CustomerDemographic)

    Private _Customer As EntityRef(Of Customer)

#Region "Extensibility Method Definitions"
    Partial Private Sub OnLoaded()
    End Sub
    Partial Private Sub OnValidate(ByVal action As System.Data.Linq.ChangeAction)
    End Sub
    Partial Private Sub OnCreated()
    End Sub
    Partial Private Sub OnCustomerIDChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnCustomerIDChanged()
    End Sub
    Partial Private Sub OnCustomerTypeIDChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnCustomerTypeIDChanged()
    End Sub
#End Region

    Public Sub New()
        MyBase.New()
        Me._CustomerDemographic = CType(Nothing, EntityRef(Of CustomerDemographic))
        Me._Customer = CType(Nothing, EntityRef(Of Customer))
        OnCreated()
    End Sub

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_CustomerID", DbType:="NChar(5) NOT NULL", CanBeNull:=False, IsPrimaryKey:=True)> _
    Public Property CustomerID() As String
        Get
            Return Me._CustomerID
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._CustomerID, value) = False) Then
                If Me._Customer.HasLoadedOrAssignedValue Then
                    Throw New System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException()
                End If
                Me.OnCustomerIDChanging(value)
                Me.SendPropertyChanging()
                Me._CustomerID = value
                Me.SendPropertyChanged("CustomerID")
                Me.OnCustomerIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_CustomerTypeID", DbType:="NChar(10) NOT NULL", CanBeNull:=False, IsPrimaryKey:=True)> _
    Public Property CustomerTypeID() As String
        Get
            Return Me._CustomerTypeID
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._CustomerTypeID, value) = False) Then
                If Me._CustomerDemographic.HasLoadedOrAssignedValue Then
                    Throw New System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException()
                End If
                Me.OnCustomerTypeIDChanging(value)
                Me.SendPropertyChanging()
                Me._CustomerTypeID = value
                Me.SendPropertyChanged("CustomerTypeID")
                Me.OnCustomerTypeIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="CustomerDemographic_CustomerCustomerDemo", Storage:="_CustomerDemographic", ThisKey:="CustomerTypeID", OtherKey:="CustomerTypeID", IsForeignKey:=True)> _
    Public Property CustomerDemographic() As CustomerDemographic
        Get
            Return Me._CustomerDemographic.Entity
        End Get
        Set(ByVal value As CustomerDemographic)
            Dim previousValue As CustomerDemographic = Me._CustomerDemographic.Entity
            If ((Object.Equals(previousValue, value) = False) _
               OrElse (Me._CustomerDemographic.HasLoadedOrAssignedValue = False)) Then
                Me.SendPropertyChanging()
                If ((previousValue Is Nothing) _
                   = False) Then
                    Me._CustomerDemographic.Entity = Nothing
                    previousValue.CustomerCustomerDemos.Remove(Me)
                End If
                Me._CustomerDemographic.Entity = value
                If ((value Is Nothing) _
                   = False) Then
                    value.CustomerCustomerDemos.Add(Me)
                    Me._CustomerTypeID = value.CustomerTypeID
                Else
                    Me._CustomerTypeID = CType(Nothing, String)
                End If
                Me.SendPropertyChanged("CustomerDemographic")
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Customer_CustomerCustomerDemo", Storage:="_Customer", ThisKey:="CustomerID", OtherKey:="CustomerID", IsForeignKey:=True)> _
    Public Property Customer() As Customer
        Get
            Return Me._Customer.Entity
        End Get
        Set(ByVal value As Customer)
            Dim previousValue As Customer = Me._Customer.Entity
            If ((Object.Equals(previousValue, value) = False) _
               OrElse (Me._Customer.HasLoadedOrAssignedValue = False)) Then
                Me.SendPropertyChanging()
                If ((previousValue Is Nothing) _
                   = False) Then
                    Me._Customer.Entity = Nothing
                    previousValue.CustomerCustomerDemos.Remove(Me)
                End If
                Me._Customer.Entity = value
                If ((value Is Nothing) _
                   = False) Then
                    value.CustomerCustomerDemos.Add(Me)
                    Me._CustomerID = value.CustomerID
                Else
                    Me._CustomerID = CType(Nothing, String)
                End If
                Me.SendPropertyChanged("Customer")
            End If
        End Set
    End Property

    Public Event PropertyChanging As PropertyChangingEventHandler Implements System.ComponentModel.INotifyPropertyChanging.PropertyChanging

    Public Event PropertyChanged As PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

    Protected Overridable Sub SendPropertyChanging()
        If ((Me.PropertyChangingEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanging(Me, emptyChangingEventArgs)
        End If
    End Sub

    Protected Overridable Sub SendPropertyChanged(ByVal propertyName As [String])
        If ((Me.PropertyChangedEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
        End If
    End Sub
End Class

<Global.System.Data.Linq.Mapping.TableAttribute(Name:="dbo.CustomerDemographics")> _
Partial Public Class CustomerDemographic
    Implements System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged

    Private Shared emptyChangingEventArgs As PropertyChangingEventArgs = New PropertyChangingEventArgs(String.Empty)

    Private _CustomerTypeID As String

    Private _CustomerDesc As String

    Private _CustomerCustomerDemos As EntitySet(Of CustomerCustomerDemo)

#Region "Extensibility Method Definitions"
    Partial Private Sub OnLoaded()
    End Sub
    Partial Private Sub OnValidate(ByVal action As System.Data.Linq.ChangeAction)
    End Sub
    Partial Private Sub OnCreated()
    End Sub
    Partial Private Sub OnCustomerTypeIDChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnCustomerTypeIDChanged()
    End Sub
    Partial Private Sub OnCustomerDescChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnCustomerDescChanged()
    End Sub
#End Region

    Public Sub New()
        MyBase.New()
        Me._CustomerCustomerDemos = New EntitySet(Of CustomerCustomerDemo)(AddressOf Me.attach_CustomerCustomerDemos, AddressOf Me.detach_CustomerCustomerDemos)
        OnCreated()
    End Sub

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_CustomerTypeID", DbType:="NChar(10) NOT NULL", CanBeNull:=False, IsPrimaryKey:=True)> _
    Public Property CustomerTypeID() As String
        Get
            Return Me._CustomerTypeID
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._CustomerTypeID, value) = False) Then
                Me.OnCustomerTypeIDChanging(value)
                Me.SendPropertyChanging()
                Me._CustomerTypeID = value
                Me.SendPropertyChanged("CustomerTypeID")
                Me.OnCustomerTypeIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_CustomerDesc", DbType:="NText", UpdateCheck:=UpdateCheck.Never)> _
    Public Property CustomerDesc() As String
        Get
            Return Me._CustomerDesc
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._CustomerDesc, value) = False) Then
                Me.OnCustomerDescChanging(value)
                Me.SendPropertyChanging()
                Me._CustomerDesc = value
                Me.SendPropertyChanged("CustomerDesc")
                Me.OnCustomerDescChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="CustomerDemographic_CustomerCustomerDemo", Storage:="_CustomerCustomerDemos", ThisKey:="CustomerTypeID", OtherKey:="CustomerTypeID")> _
    Public Property CustomerCustomerDemos() As EntitySet(Of CustomerCustomerDemo)
        Get
            Return Me._CustomerCustomerDemos
        End Get
        Set(ByVal value As EntitySet(Of CustomerCustomerDemo))
            Me._CustomerCustomerDemos.Assign(value)
        End Set
    End Property

    Public Event PropertyChanging As PropertyChangingEventHandler Implements System.ComponentModel.INotifyPropertyChanging.PropertyChanging

    Public Event PropertyChanged As PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

    Protected Overridable Sub SendPropertyChanging()
        If ((Me.PropertyChangingEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanging(Me, emptyChangingEventArgs)
        End If
    End Sub

    Protected Overridable Sub SendPropertyChanged(ByVal propertyName As [String])
        If ((Me.PropertyChangedEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
        End If
    End Sub

    Private Sub attach_CustomerCustomerDemos(ByVal entity As CustomerCustomerDemo)
        Me.SendPropertyChanging()
        entity.CustomerDemographic = Me
    End Sub

    Private Sub detach_CustomerCustomerDemos(ByVal entity As CustomerCustomerDemo)
        Me.SendPropertyChanging()
        entity.CustomerDemographic = Nothing
    End Sub
End Class

<Global.System.Data.Linq.Mapping.TableAttribute(Name:="dbo.Customers")> _
Partial Public Class Customer
    Implements System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged

    Private Shared emptyChangingEventArgs As PropertyChangingEventArgs = New PropertyChangingEventArgs(String.Empty)

    Private _CustomerID As String

    Private _CompanyName As String

    Private _ContactName As String

    Private _ContactTitle As String

    Private _Address As String

    Private _City As String

    Private _Region As String

    Private _PostalCode As String

    Private _Country As String

    Private _Phone As String

    Private _Fax As String

    Private _CustomerCustomerDemos As EntitySet(Of CustomerCustomerDemo)

    Private _Orders As EntitySet(Of [Order])

#Region "Extensibility Method Definitions"
    Partial Private Sub OnLoaded()
    End Sub
    Partial Private Sub OnValidate(ByVal action As System.Data.Linq.ChangeAction)
    End Sub
    Partial Private Sub OnCreated()
    End Sub
    Partial Private Sub OnCustomerIDChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnCustomerIDChanged()
    End Sub
    Partial Private Sub OnCompanyNameChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnCompanyNameChanged()
    End Sub
    Partial Private Sub OnContactNameChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnContactNameChanged()
    End Sub
    Partial Private Sub OnContactTitleChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnContactTitleChanged()
    End Sub
    Partial Private Sub OnAddressChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnAddressChanged()
    End Sub
    Partial Private Sub OnCityChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnCityChanged()
    End Sub
    Partial Private Sub OnRegionChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnRegionChanged()
    End Sub
    Partial Private Sub OnPostalCodeChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnPostalCodeChanged()
    End Sub
    Partial Private Sub OnCountryChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnCountryChanged()
    End Sub
    Partial Private Sub OnPhoneChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnPhoneChanged()
    End Sub
    Partial Private Sub OnFaxChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnFaxChanged()
    End Sub
#End Region

    Public Sub New()
        MyBase.New()
        Me._CustomerCustomerDemos = New EntitySet(Of CustomerCustomerDemo)(AddressOf Me.attach_CustomerCustomerDemos, AddressOf Me.detach_CustomerCustomerDemos)
        Me._Orders = New EntitySet(Of [Order])(AddressOf Me.attach_Orders, AddressOf Me.detach_Orders)
        OnCreated()
    End Sub

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_CustomerID", DbType:="NChar(5) NOT NULL", CanBeNull:=False, IsPrimaryKey:=True)> _
    Public Property CustomerID() As String
        Get
            Return Me._CustomerID
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._CustomerID, value) = False) Then
                Me.OnCustomerIDChanging(value)
                Me.SendPropertyChanging()
                Me._CustomerID = value
                Me.SendPropertyChanged("CustomerID")
                Me.OnCustomerIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_CompanyName", DbType:="NVarChar(40) NOT NULL", CanBeNull:=False)> _
    Public Property CompanyName() As String
        Get
            Return Me._CompanyName
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._CompanyName, value) = False) Then
                Me.OnCompanyNameChanging(value)
                Me.SendPropertyChanging()
                Me._CompanyName = value
                Me.SendPropertyChanged("CompanyName")
                Me.OnCompanyNameChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_ContactName", DbType:="NVarChar(30)")> _
    Public Property ContactName() As String
        Get
            Return Me._ContactName
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._ContactName, value) = False) Then
                Me.OnContactNameChanging(value)
                Me.SendPropertyChanging()
                Me._ContactName = value
                Me.SendPropertyChanged("ContactName")
                Me.OnContactNameChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_ContactTitle", DbType:="NVarChar(30)")> _
    Public Property ContactTitle() As String
        Get
            Return Me._ContactTitle
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._ContactTitle, value) = False) Then
                Me.OnContactTitleChanging(value)
                Me.SendPropertyChanging()
                Me._ContactTitle = value
                Me.SendPropertyChanged("ContactTitle")
                Me.OnContactTitleChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Address", DbType:="NVarChar(60)")> _
    Public Property Address() As String
        Get
            Return Me._Address
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._Address, value) = False) Then
                Me.OnAddressChanging(value)
                Me.SendPropertyChanging()
                Me._Address = value
                Me.SendPropertyChanged("Address")
                Me.OnAddressChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_City", DbType:="NVarChar(15)")> _
    Public Property City() As String
        Get
            Return Me._City
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._City, value) = False) Then
                Me.OnCityChanging(value)
                Me.SendPropertyChanging()
                Me._City = value
                Me.SendPropertyChanged("City")
                Me.OnCityChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Region", DbType:="NVarChar(15)")> _
    Public Property Region() As String
        Get
            Return Me._Region
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._Region, value) = False) Then
                Me.OnRegionChanging(value)
                Me.SendPropertyChanging()
                Me._Region = value
                Me.SendPropertyChanged("Region")
                Me.OnRegionChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_PostalCode", DbType:="NVarChar(10)")> _
    Public Property PostalCode() As String
        Get
            Return Me._PostalCode
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._PostalCode, value) = False) Then
                Me.OnPostalCodeChanging(value)
                Me.SendPropertyChanging()
                Me._PostalCode = value
                Me.SendPropertyChanged("PostalCode")
                Me.OnPostalCodeChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Country", DbType:="NVarChar(15)")> _
    Public Property Country() As String
        Get
            Return Me._Country
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._Country, value) = False) Then
                Me.OnCountryChanging(value)
                Me.SendPropertyChanging()
                Me._Country = value
                Me.SendPropertyChanged("Country")
                Me.OnCountryChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Phone", DbType:="NVarChar(24)")> _
    Public Property Phone() As String
        Get
            Return Me._Phone
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._Phone, value) = False) Then
                Me.OnPhoneChanging(value)
                Me.SendPropertyChanging()
                Me._Phone = value
                Me.SendPropertyChanged("Phone")
                Me.OnPhoneChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Fax", DbType:="NVarChar(24)")> _
    Public Property Fax() As String
        Get
            Return Me._Fax
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._Fax, value) = False) Then
                Me.OnFaxChanging(value)
                Me.SendPropertyChanging()
                Me._Fax = value
                Me.SendPropertyChanged("Fax")
                Me.OnFaxChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Customer_CustomerCustomerDemo", Storage:="_CustomerCustomerDemos", ThisKey:="CustomerID", OtherKey:="CustomerID")> _
    Public Property CustomerCustomerDemos() As EntitySet(Of CustomerCustomerDemo)
        Get
            Return Me._CustomerCustomerDemos
        End Get
        Set(ByVal value As EntitySet(Of CustomerCustomerDemo))
            Me._CustomerCustomerDemos.Assign(value)
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Customer_Order", Storage:="_Orders", ThisKey:="CustomerID", OtherKey:="CustomerID")> _
    Public Property Orders() As EntitySet(Of [Order])
        Get
            Return Me._Orders
        End Get
        Set(ByVal value As EntitySet(Of [Order]))
            Me._Orders.Assign(value)
        End Set
    End Property

    Public Event PropertyChanging As PropertyChangingEventHandler Implements System.ComponentModel.INotifyPropertyChanging.PropertyChanging

    Public Event PropertyChanged As PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

    Protected Overridable Sub SendPropertyChanging()
        If ((Me.PropertyChangingEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanging(Me, emptyChangingEventArgs)
        End If
    End Sub

    Protected Overridable Sub SendPropertyChanged(ByVal propertyName As [String])
        If ((Me.PropertyChangedEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
        End If
    End Sub

    Private Sub attach_CustomerCustomerDemos(ByVal entity As CustomerCustomerDemo)
        Me.SendPropertyChanging()
        entity.Customer = Me
    End Sub

    Private Sub detach_CustomerCustomerDemos(ByVal entity As CustomerCustomerDemo)
        Me.SendPropertyChanging()
        entity.Customer = Nothing
    End Sub

    Private Sub attach_Orders(ByVal entity As [Order])
        Me.SendPropertyChanging()
        entity.Customer = Me
    End Sub

    Private Sub detach_Orders(ByVal entity As [Order])
        Me.SendPropertyChanging()
        entity.Customer = Nothing
    End Sub
End Class

<ScaffoldTable(False)> _
<Global.System.Data.Linq.Mapping.TableAttribute(Name:="dbo.Employees")> _
Partial Public Class Employee
    Implements System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged

    Private Shared emptyChangingEventArgs As PropertyChangingEventArgs = New PropertyChangingEventArgs(String.Empty)

    Private _EmployeeID As Integer

    Private _LastName As String

    Private _FirstName As String

    Private _Title As String

    Private _TitleOfCourtesy As String

    Private _BirthDate As System.Nullable(Of Date)

    Private _HireDate As System.Nullable(Of Date)

    Private _Address As String

    Private _City As String

    Private _Region As String

    Private _PostalCode As String

    Private _Country As String

    Private _HomePhone As String

    Private _Extension As String

    Private _Photo As System.Data.Linq.Binary

    Private _Notes As String

    Private _ReportsTo As System.Nullable(Of Integer)

    Private _PhotoPath As String

    Private _Employees As EntitySet(Of Employee)

    Private _EmployeeTerritories As EntitySet(Of EmployeeTerritory)

    Private _Orders As EntitySet(Of [Order])

    Private _Employee As EntityRef(Of Employee)

#Region "Extensibility Method Definitions"
    Partial Private Sub OnLoaded()
    End Sub
    Partial Private Sub OnValidate(ByVal action As System.Data.Linq.ChangeAction)
    End Sub
    Partial Private Sub OnCreated()
    End Sub
    Partial Private Sub OnEmployeeIDChanging(ByVal value As Integer)
    End Sub
    Partial Private Sub OnEmployeeIDChanged()
    End Sub
    Partial Private Sub OnLastNameChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnLastNameChanged()
    End Sub
    Partial Private Sub OnFirstNameChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnFirstNameChanged()
    End Sub
    Partial Private Sub OnTitleChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnTitleChanged()
    End Sub
    Partial Private Sub OnTitleOfCourtesyChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnTitleOfCourtesyChanged()
    End Sub
    Partial Private Sub OnBirthDateChanging(ByVal value As System.Nullable(Of Date))
    End Sub
    Partial Private Sub OnBirthDateChanged()
    End Sub
    Partial Private Sub OnHireDateChanging(ByVal value As System.Nullable(Of Date))
    End Sub
    Partial Private Sub OnHireDateChanged()
    End Sub
    Partial Private Sub OnAddressChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnAddressChanged()
    End Sub
    Partial Private Sub OnCityChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnCityChanged()
    End Sub
    Partial Private Sub OnRegionChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnRegionChanged()
    End Sub
    Partial Private Sub OnPostalCodeChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnPostalCodeChanged()
    End Sub
    Partial Private Sub OnCountryChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnCountryChanged()
    End Sub
    Partial Private Sub OnHomePhoneChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnHomePhoneChanged()
    End Sub
    Partial Private Sub OnExtensionChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnExtensionChanged()
    End Sub
    Partial Private Sub OnPhotoChanging(ByVal value As System.Data.Linq.Binary)
    End Sub
    Partial Private Sub OnPhotoChanged()
    End Sub
    Partial Private Sub OnNotesChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnNotesChanged()
    End Sub
    Partial Private Sub OnReportsToChanging(ByVal value As System.Nullable(Of Integer))
    End Sub
    Partial Private Sub OnReportsToChanged()
    End Sub
    Partial Private Sub OnPhotoPathChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnPhotoPathChanged()
    End Sub
#End Region

    Public Sub New()
        MyBase.New()
        Me._Employees = New EntitySet(Of Employee)(AddressOf Me.attach_Employees, AddressOf Me.detach_Employees)
        Me._EmployeeTerritories = New EntitySet(Of EmployeeTerritory)(AddressOf Me.attach_EmployeeTerritories, AddressOf Me.detach_EmployeeTerritories)
        Me._Orders = New EntitySet(Of [Order])(AddressOf Me.attach_Orders, AddressOf Me.detach_Orders)
        Me._Employee = CType(Nothing, EntityRef(Of Employee))
        OnCreated()
    End Sub

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_EmployeeID", AutoSync:=AutoSync.OnInsert, DbType:="Int NOT NULL IDENTITY", IsPrimaryKey:=True, IsDbGenerated:=True)> _
    Public Property EmployeeID() As Integer
        Get
            Return Me._EmployeeID
        End Get
        Set(ByVal value As Integer)
            If ((Me._EmployeeID = value) _
               = False) Then
                Me.OnEmployeeIDChanging(value)
                Me.SendPropertyChanging()
                Me._EmployeeID = value
                Me.SendPropertyChanged("EmployeeID")
                Me.OnEmployeeIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_LastName", DbType:="NVarChar(20) NOT NULL", CanBeNull:=False)> _
    Public Property LastName() As String
        Get
            Return Me._LastName
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._LastName, value) = False) Then
                Me.OnLastNameChanging(value)
                Me.SendPropertyChanging()
                Me._LastName = value
                Me.SendPropertyChanged("LastName")
                Me.OnLastNameChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_FirstName", DbType:="NVarChar(10) NOT NULL", CanBeNull:=False)> _
    Public Property FirstName() As String
        Get
            Return Me._FirstName
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._FirstName, value) = False) Then
                Me.OnFirstNameChanging(value)
                Me.SendPropertyChanging()
                Me._FirstName = value
                Me.SendPropertyChanged("FirstName")
                Me.OnFirstNameChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Title", DbType:="NVarChar(30)")> _
    Public Property Title() As String
        Get
            Return Me._Title
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._Title, value) = False) Then
                Me.OnTitleChanging(value)
                Me.SendPropertyChanging()
                Me._Title = value
                Me.SendPropertyChanged("Title")
                Me.OnTitleChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_TitleOfCourtesy", DbType:="NVarChar(25)")> _
    Public Property TitleOfCourtesy() As String
        Get
            Return Me._TitleOfCourtesy
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._TitleOfCourtesy, value) = False) Then
                Me.OnTitleOfCourtesyChanging(value)
                Me.SendPropertyChanging()
                Me._TitleOfCourtesy = value
                Me.SendPropertyChanged("TitleOfCourtesy")
                Me.OnTitleOfCourtesyChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_BirthDate", DbType:="DateTime")> _
    Public Property BirthDate() As System.Nullable(Of Date)
        Get
            Return Me._BirthDate
        End Get
        Set(ByVal value As System.Nullable(Of Date))
            If (Me._BirthDate.Equals(value) = False) Then
                Me.OnBirthDateChanging(value)
                Me.SendPropertyChanging()
                Me._BirthDate = value
                Me.SendPropertyChanged("BirthDate")
                Me.OnBirthDateChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_HireDate", DbType:="DateTime")> _
    Public Property HireDate() As System.Nullable(Of Date)
        Get
            Return Me._HireDate
        End Get
        Set(ByVal value As System.Nullable(Of Date))
            If (Me._HireDate.Equals(value) = False) Then
                Me.OnHireDateChanging(value)
                Me.SendPropertyChanging()
                Me._HireDate = value
                Me.SendPropertyChanged("HireDate")
                Me.OnHireDateChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Address", DbType:="NVarChar(60)")> _
    Public Property Address() As String
        Get
            Return Me._Address
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._Address, value) = False) Then
                Me.OnAddressChanging(value)
                Me.SendPropertyChanging()
                Me._Address = value
                Me.SendPropertyChanged("Address")
                Me.OnAddressChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_City", DbType:="NVarChar(15)")> _
    Public Property City() As String
        Get
            Return Me._City
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._City, value) = False) Then
                Me.OnCityChanging(value)
                Me.SendPropertyChanging()
                Me._City = value
                Me.SendPropertyChanged("City")
                Me.OnCityChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Region", DbType:="NVarChar(15)")> _
    Public Property Region() As String
        Get
            Return Me._Region
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._Region, value) = False) Then
                Me.OnRegionChanging(value)
                Me.SendPropertyChanging()
                Me._Region = value
                Me.SendPropertyChanged("Region")
                Me.OnRegionChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_PostalCode", DbType:="NVarChar(10)")> _
    Public Property PostalCode() As String
        Get
            Return Me._PostalCode
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._PostalCode, value) = False) Then
                Me.OnPostalCodeChanging(value)
                Me.SendPropertyChanging()
                Me._PostalCode = value
                Me.SendPropertyChanged("PostalCode")
                Me.OnPostalCodeChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Country", DbType:="NVarChar(15)")> _
    Public Property Country() As String
        Get
            Return Me._Country
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._Country, value) = False) Then
                Me.OnCountryChanging(value)
                Me.SendPropertyChanging()
                Me._Country = value
                Me.SendPropertyChanged("Country")
                Me.OnCountryChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_HomePhone", DbType:="NVarChar(24)")> _
    Public Property HomePhone() As String
        Get
            Return Me._HomePhone
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._HomePhone, value) = False) Then
                Me.OnHomePhoneChanging(value)
                Me.SendPropertyChanging()
                Me._HomePhone = value
                Me.SendPropertyChanged("HomePhone")
                Me.OnHomePhoneChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Extension", DbType:="NVarChar(4)")> _
    Public Property Extension() As String
        Get
            Return Me._Extension
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._Extension, value) = False) Then
                Me.OnExtensionChanging(value)
                Me.SendPropertyChanging()
                Me._Extension = value
                Me.SendPropertyChanged("Extension")
                Me.OnExtensionChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Photo", DbType:="Image", UpdateCheck:=UpdateCheck.Never)> _
    Public Property Photo() As System.Data.Linq.Binary
        Get
            Return Me._Photo
        End Get
        Set(ByVal value As System.Data.Linq.Binary)
            If (Object.Equals(Me._Photo, value) = False) Then
                Me.OnPhotoChanging(value)
                Me.SendPropertyChanging()
                Me._Photo = value
                Me.SendPropertyChanged("Photo")
                Me.OnPhotoChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Notes", DbType:="NText", UpdateCheck:=UpdateCheck.Never)> _
    Public Property Notes() As String
        Get
            Return Me._Notes
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._Notes, value) = False) Then
                Me.OnNotesChanging(value)
                Me.SendPropertyChanging()
                Me._Notes = value
                Me.SendPropertyChanged("Notes")
                Me.OnNotesChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_ReportsTo", DbType:="Int")> _
    Public Property ReportsTo() As System.Nullable(Of Integer)
        Get
            Return Me._ReportsTo
        End Get
        Set(ByVal value As System.Nullable(Of Integer))
            If (Me._ReportsTo.Equals(value) = False) Then
                If Me._Employee.HasLoadedOrAssignedValue Then
                    Throw New System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException()
                End If
                Me.OnReportsToChanging(value)
                Me.SendPropertyChanging()
                Me._ReportsTo = value
                Me.SendPropertyChanged("ReportsTo")
                Me.OnReportsToChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_PhotoPath", DbType:="NVarChar(255)")> _
    Public Property PhotoPath() As String
        Get
            Return Me._PhotoPath
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._PhotoPath, value) = False) Then
                Me.OnPhotoPathChanging(value)
                Me.SendPropertyChanging()
                Me._PhotoPath = value
                Me.SendPropertyChanged("PhotoPath")
                Me.OnPhotoPathChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Employee_Employee", Storage:="_Employees", ThisKey:="EmployeeID", OtherKey:="ReportsTo")> _
    Public Property Employees() As EntitySet(Of Employee)
        Get
            Return Me._Employees
        End Get
        Set(ByVal value As EntitySet(Of Employee))
            Me._Employees.Assign(value)
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Employee_EmployeeTerritory", Storage:="_EmployeeTerritories", ThisKey:="EmployeeID", OtherKey:="EmployeeID")> _
    Public Property EmployeeTerritories() As EntitySet(Of EmployeeTerritory)
        Get
            Return Me._EmployeeTerritories
        End Get
        Set(ByVal value As EntitySet(Of EmployeeTerritory))
            Me._EmployeeTerritories.Assign(value)
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Employee_Order", Storage:="_Orders", ThisKey:="EmployeeID", OtherKey:="EmployeeID")> _
    Public Property Orders() As EntitySet(Of [Order])
        Get
            Return Me._Orders
        End Get
        Set(ByVal value As EntitySet(Of [Order]))
            Me._Orders.Assign(value)
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Employee_Employee", Storage:="_Employee", ThisKey:="ReportsTo", OtherKey:="EmployeeID", IsForeignKey:=True)> _
    Public Property Employee() As Employee
        Get
            Return Me._Employee.Entity
        End Get
        Set(ByVal value As Employee)
            Dim previousValue As Employee = Me._Employee.Entity
            If ((Object.Equals(previousValue, value) = False) _
               OrElse (Me._Employee.HasLoadedOrAssignedValue = False)) Then
                Me.SendPropertyChanging()
                If ((previousValue Is Nothing) _
                   = False) Then
                    Me._Employee.Entity = Nothing
                    previousValue.Employees.Remove(Me)
                End If
                Me._Employee.Entity = value
                If ((value Is Nothing) _
                   = False) Then
                    value.Employees.Add(Me)
                    Me._ReportsTo = value.EmployeeID
                Else
                    Me._ReportsTo = CType(Nothing, Nullable(Of Integer))
                End If
                Me.SendPropertyChanged("Employee")
            End If
        End Set
    End Property

    Public Event PropertyChanging As PropertyChangingEventHandler Implements System.ComponentModel.INotifyPropertyChanging.PropertyChanging

    Public Event PropertyChanged As PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

    Protected Overridable Sub SendPropertyChanging()
        If ((Me.PropertyChangingEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanging(Me, emptyChangingEventArgs)
        End If
    End Sub

    Protected Overridable Sub SendPropertyChanged(ByVal propertyName As [String])
        If ((Me.PropertyChangedEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
        End If
    End Sub

    Private Sub attach_Employees(ByVal entity As Employee)
        Me.SendPropertyChanging()
        entity.Employee = Me
    End Sub

    Private Sub detach_Employees(ByVal entity As Employee)
        Me.SendPropertyChanging()
        entity.Employee = Nothing
    End Sub

    Private Sub attach_EmployeeTerritories(ByVal entity As EmployeeTerritory)
        Me.SendPropertyChanging()
        entity.Employee = Me
    End Sub

    Private Sub detach_EmployeeTerritories(ByVal entity As EmployeeTerritory)
        Me.SendPropertyChanging()
        entity.Employee = Nothing
    End Sub

    Private Sub attach_Orders(ByVal entity As [Order])
        Me.SendPropertyChanging()
        entity.Employee = Me
    End Sub

    Private Sub detach_Orders(ByVal entity As [Order])
        Me.SendPropertyChanging()
        entity.Employee = Nothing
    End Sub
End Class

<Global.System.Data.Linq.Mapping.TableAttribute(Name:="dbo.EmployeeTerritories")> _
Partial Public Class EmployeeTerritory
    Implements System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged

    Private Shared emptyChangingEventArgs As PropertyChangingEventArgs = New PropertyChangingEventArgs(String.Empty)

    Private _EmployeeID As Integer

    Private _TerritoryID As String

    Private _Employee As EntityRef(Of Employee)

    Private _Territory As EntityRef(Of Territory)

#Region "Extensibility Method Definitions"
    Partial Private Sub OnLoaded()
    End Sub
    Partial Private Sub OnValidate(ByVal action As System.Data.Linq.ChangeAction)
    End Sub
    Partial Private Sub OnCreated()
    End Sub
    Partial Private Sub OnEmployeeIDChanging(ByVal value As Integer)
    End Sub
    Partial Private Sub OnEmployeeIDChanged()
    End Sub
    Partial Private Sub OnTerritoryIDChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnTerritoryIDChanged()
    End Sub
#End Region

    Public Sub New()
        MyBase.New()
        Me._Employee = CType(Nothing, EntityRef(Of Employee))
        Me._Territory = CType(Nothing, EntityRef(Of Territory))
        OnCreated()
    End Sub

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_EmployeeID", DbType:="Int NOT NULL", IsPrimaryKey:=True)> _
    Public Property EmployeeID() As Integer
        Get
            Return Me._EmployeeID
        End Get
        Set(ByVal value As Integer)
            If ((Me._EmployeeID = value) _
               = False) Then
                If Me._Employee.HasLoadedOrAssignedValue Then
                    Throw New System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException()
                End If
                Me.OnEmployeeIDChanging(value)
                Me.SendPropertyChanging()
                Me._EmployeeID = value
                Me.SendPropertyChanged("EmployeeID")
                Me.OnEmployeeIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_TerritoryID", DbType:="NVarChar(20) NOT NULL", CanBeNull:=False, IsPrimaryKey:=True)> _
    Public Property TerritoryID() As String
        Get
            Return Me._TerritoryID
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._TerritoryID, value) = False) Then
                If Me._Territory.HasLoadedOrAssignedValue Then
                    Throw New System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException()
                End If
                Me.OnTerritoryIDChanging(value)
                Me.SendPropertyChanging()
                Me._TerritoryID = value
                Me.SendPropertyChanged("TerritoryID")
                Me.OnTerritoryIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Employee_EmployeeTerritory", Storage:="_Employee", ThisKey:="EmployeeID", OtherKey:="EmployeeID", IsForeignKey:=True)> _
    Public Property Employee() As Employee
        Get
            Return Me._Employee.Entity
        End Get
        Set(ByVal value As Employee)
            Dim previousValue As Employee = Me._Employee.Entity
            If ((Object.Equals(previousValue, value) = False) _
               OrElse (Me._Employee.HasLoadedOrAssignedValue = False)) Then
                Me.SendPropertyChanging()
                If ((previousValue Is Nothing) _
                   = False) Then
                    Me._Employee.Entity = Nothing
                    previousValue.EmployeeTerritories.Remove(Me)
                End If
                Me._Employee.Entity = value
                If ((value Is Nothing) _
                   = False) Then
                    value.EmployeeTerritories.Add(Me)
                    Me._EmployeeID = value.EmployeeID
                Else
                    Me._EmployeeID = CType(Nothing, Integer)
                End If
                Me.SendPropertyChanged("Employee")
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Territory_EmployeeTerritory", Storage:="_Territory", ThisKey:="TerritoryID", OtherKey:="TerritoryID", IsForeignKey:=True)> _
    Public Property Territory() As Territory
        Get
            Return Me._Territory.Entity
        End Get
        Set(ByVal value As Territory)
            Dim previousValue As Territory = Me._Territory.Entity
            If ((Object.Equals(previousValue, value) = False) _
               OrElse (Me._Territory.HasLoadedOrAssignedValue = False)) Then
                Me.SendPropertyChanging()
                If ((previousValue Is Nothing) _
                   = False) Then
                    Me._Territory.Entity = Nothing
                    previousValue.EmployeeTerritories.Remove(Me)
                End If
                Me._Territory.Entity = value
                If ((value Is Nothing) _
                   = False) Then
                    value.EmployeeTerritories.Add(Me)
                    Me._TerritoryID = value.TerritoryID
                Else
                    Me._TerritoryID = CType(Nothing, String)
                End If
                Me.SendPropertyChanged("Territory")
            End If
        End Set
    End Property

    Public Event PropertyChanging As PropertyChangingEventHandler Implements System.ComponentModel.INotifyPropertyChanging.PropertyChanging

    Public Event PropertyChanged As PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

    Protected Overridable Sub SendPropertyChanging()
        If ((Me.PropertyChangingEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanging(Me, emptyChangingEventArgs)
        End If
    End Sub

    Protected Overridable Sub SendPropertyChanged(ByVal propertyName As [String])
        If ((Me.PropertyChangedEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
        End If
    End Sub
End Class

<Global.System.Data.Linq.Mapping.TableAttribute(Name:="dbo.[Order Details]")> _
Partial Public Class Order_Detail
    Implements System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged

    Private Shared emptyChangingEventArgs As PropertyChangingEventArgs = New PropertyChangingEventArgs(String.Empty)

    Private _OrderID As Integer

    Private _ProductID As Integer

    Private _UnitPrice As Decimal

    Private _Quantity As Short

    Private _Discount As Single

    Private _Order As EntityRef(Of [Order])

    Private _Product As EntityRef(Of Product)

#Region "Extensibility Method Definitions"
    Partial Private Sub OnLoaded()
    End Sub
    Partial Private Sub OnValidate(ByVal action As System.Data.Linq.ChangeAction)
    End Sub
    Partial Private Sub OnCreated()
    End Sub
    Partial Private Sub OnOrderIDChanging(ByVal value As Integer)
    End Sub
    Partial Private Sub OnOrderIDChanged()
    End Sub
    Partial Private Sub OnProductIDChanging(ByVal value As Integer)
    End Sub
    Partial Private Sub OnProductIDChanged()
    End Sub
    Partial Private Sub OnUnitPriceChanging(ByVal value As Decimal)
    End Sub
    Partial Private Sub OnUnitPriceChanged()
    End Sub
    Partial Private Sub OnQuantityChanging(ByVal value As Short)
    End Sub
    Partial Private Sub OnQuantityChanged()
    End Sub
    Partial Private Sub OnDiscountChanging(ByVal value As Single)
    End Sub
    Partial Private Sub OnDiscountChanged()
    End Sub
#End Region

    Public Sub New()
        MyBase.New()
        Me._Order = CType(Nothing, EntityRef(Of [Order]))
        Me._Product = CType(Nothing, EntityRef(Of Product))
        OnCreated()
    End Sub

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_OrderID", DbType:="Int NOT NULL", IsPrimaryKey:=True)> _
    Public Property OrderID() As Integer
        Get
            Return Me._OrderID
        End Get
        Set(ByVal value As Integer)
            If ((Me._OrderID = value) _
               = False) Then
                If Me._Order.HasLoadedOrAssignedValue Then
                    Throw New System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException()
                End If
                Me.OnOrderIDChanging(value)
                Me.SendPropertyChanging()
                Me._OrderID = value
                Me.SendPropertyChanged("OrderID")
                Me.OnOrderIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_ProductID", DbType:="Int NOT NULL", IsPrimaryKey:=True)> _
    Public Property ProductID() As Integer
        Get
            Return Me._ProductID
        End Get
        Set(ByVal value As Integer)
            If ((Me._ProductID = value) _
               = False) Then
                If Me._Product.HasLoadedOrAssignedValue Then
                    Throw New System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException()
                End If
                Me.OnProductIDChanging(value)
                Me.SendPropertyChanging()
                Me._ProductID = value
                Me.SendPropertyChanged("ProductID")
                Me.OnProductIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_UnitPrice", DbType:="Money NOT NULL")> _
    Public Property UnitPrice() As Decimal
        Get
            Return Me._UnitPrice
        End Get
        Set(ByVal value As Decimal)
            If ((Me._UnitPrice = value) _
               = False) Then
                Me.OnUnitPriceChanging(value)
                Me.SendPropertyChanging()
                Me._UnitPrice = value
                Me.SendPropertyChanged("UnitPrice")
                Me.OnUnitPriceChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Quantity", DbType:="SmallInt NOT NULL")> _
    Public Property Quantity() As Short
        Get
            Return Me._Quantity
        End Get
        Set(ByVal value As Short)
            If ((Me._Quantity = value) _
               = False) Then
                Me.OnQuantityChanging(value)
                Me.SendPropertyChanging()
                Me._Quantity = value
                Me.SendPropertyChanged("Quantity")
                Me.OnQuantityChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Discount", DbType:="Real NOT NULL")> _
    Public Property Discount() As Single
        Get
            Return Me._Discount
        End Get
        Set(ByVal value As Single)
            If ((Me._Discount = value) _
               = False) Then
                Me.OnDiscountChanging(value)
                Me.SendPropertyChanging()
                Me._Discount = value
                Me.SendPropertyChanged("Discount")
                Me.OnDiscountChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Order_Order_Detail", Storage:="_Order", ThisKey:="OrderID", OtherKey:="OrderID", IsForeignKey:=True)> _
    Public Property [Order]() As [Order]
        Get
            Return Me._Order.Entity
        End Get
        Set(ByVal value As [Order])
            Dim previousValue As [Order] = Me._Order.Entity
            If ((Object.Equals(previousValue, value) = False) _
               OrElse (Me._Order.HasLoadedOrAssignedValue = False)) Then
                Me.SendPropertyChanging()
                If ((previousValue Is Nothing) _
                   = False) Then
                    Me._Order.Entity = Nothing
                    previousValue.Order_Details.Remove(Me)
                End If
                Me._Order.Entity = value
                If ((value Is Nothing) _
                   = False) Then
                    value.Order_Details.Add(Me)
                    Me._OrderID = value.OrderID
                Else
                    Me._OrderID = CType(Nothing, Integer)
                End If
                Me.SendPropertyChanged("[Order]")
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Product_Order_Detail", Storage:="_Product", ThisKey:="ProductID", OtherKey:="ProductID", IsForeignKey:=True)> _
    Public Property Product() As Product
        Get
            Return Me._Product.Entity
        End Get
        Set(ByVal value As Product)
            Dim previousValue As Product = Me._Product.Entity
            If ((Object.Equals(previousValue, value) = False) _
               OrElse (Me._Product.HasLoadedOrAssignedValue = False)) Then
                Me.SendPropertyChanging()
                If ((previousValue Is Nothing) _
                   = False) Then
                    Me._Product.Entity = Nothing
                    previousValue.Order_Details.Remove(Me)
                End If
                Me._Product.Entity = value
                If ((value Is Nothing) _
                   = False) Then
                    value.Order_Details.Add(Me)
                    Me._ProductID = value.ProductID
                Else
                    Me._ProductID = CType(Nothing, Integer)
                End If
                Me.SendPropertyChanged("Product")
            End If
        End Set
    End Property

    Public Event PropertyChanging As PropertyChangingEventHandler Implements System.ComponentModel.INotifyPropertyChanging.PropertyChanging

    Public Event PropertyChanged As PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

    Protected Overridable Sub SendPropertyChanging()
        If ((Me.PropertyChangingEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanging(Me, emptyChangingEventArgs)
        End If
    End Sub

    Protected Overridable Sub SendPropertyChanged(ByVal propertyName As [String])
        If ((Me.PropertyChangedEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
        End If
    End Sub
End Class

<Global.System.Data.Linq.Mapping.TableAttribute(Name:="dbo.Orders")> _
Partial Public Class [Order]
    Implements System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged

    Private Shared emptyChangingEventArgs As PropertyChangingEventArgs = New PropertyChangingEventArgs(String.Empty)

    Private _OrderID As Integer

    Private _CustomerID As String

    Private _EmployeeID As System.Nullable(Of Integer)

    Private _OrderDate As System.Nullable(Of Date)

    Private _RequiredDate As System.Nullable(Of Date)

    Private _ShippedDate As System.Nullable(Of Date)

    Private _ShipVia As System.Nullable(Of Integer)

    Private _Freight As System.Nullable(Of Decimal)

    Private _ShipName As String

    Private _ShipAddress As String

    Private _ShipCity As String

    Private _ShipRegion As String

    Private _ShipPostalCode As String

    Private _ShipCountry As String

    Private _Order_Details As EntitySet(Of Order_Detail)

    Private _Customer As EntityRef(Of Customer)

    Private _Employee As EntityRef(Of Employee)

    Private _Shipper As EntityRef(Of Shipper)

#Region "Extensibility Method Definitions"
    Partial Private Sub OnLoaded()
    End Sub
    Partial Private Sub OnValidate(ByVal action As System.Data.Linq.ChangeAction)
    End Sub
    Partial Private Sub OnCreated()
    End Sub
    Partial Private Sub OnOrderIDChanging(ByVal value As Integer)
    End Sub
    Partial Private Sub OnOrderIDChanged()
    End Sub
    Partial Private Sub OnCustomerIDChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnCustomerIDChanged()
    End Sub
    Partial Private Sub OnEmployeeIDChanging(ByVal value As System.Nullable(Of Integer))
    End Sub
    Partial Private Sub OnEmployeeIDChanged()
    End Sub
    Partial Private Sub OnOrderDateChanging(ByVal value As System.Nullable(Of Date))
    End Sub
    Partial Private Sub OnOrderDateChanged()
    End Sub
    Partial Private Sub OnRequiredDateChanging(ByVal value As System.Nullable(Of Date))
    End Sub
    Partial Private Sub OnRequiredDateChanged()
    End Sub
    Partial Private Sub OnShippedDateChanging(ByVal value As System.Nullable(Of Date))
    End Sub
    Partial Private Sub OnShippedDateChanged()
    End Sub
    Partial Private Sub OnShipViaChanging(ByVal value As System.Nullable(Of Integer))
    End Sub
    Partial Private Sub OnShipViaChanged()
    End Sub
    Partial Private Sub OnFreightChanging(ByVal value As System.Nullable(Of Decimal))
    End Sub
    Partial Private Sub OnFreightChanged()
    End Sub
    Partial Private Sub OnShipNameChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnShipNameChanged()
    End Sub
    Partial Private Sub OnShipAddressChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnShipAddressChanged()
    End Sub
    Partial Private Sub OnShipCityChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnShipCityChanged()
    End Sub
    Partial Private Sub OnShipRegionChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnShipRegionChanged()
    End Sub
    Partial Private Sub OnShipPostalCodeChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnShipPostalCodeChanged()
    End Sub
    Partial Private Sub OnShipCountryChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnShipCountryChanged()
    End Sub
#End Region

    Public Sub New()
        MyBase.New()
        Me._Order_Details = New EntitySet(Of Order_Detail)(AddressOf Me.attach_Order_Details, AddressOf Me.detach_Order_Details)
        Me._Customer = CType(Nothing, EntityRef(Of Customer))
        Me._Employee = CType(Nothing, EntityRef(Of Employee))
        Me._Shipper = CType(Nothing, EntityRef(Of Shipper))
        OnCreated()
    End Sub

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_OrderID", AutoSync:=AutoSync.OnInsert, DbType:="Int NOT NULL IDENTITY", IsPrimaryKey:=True, IsDbGenerated:=True)> _
    Public Property OrderID() As Integer
        Get
            Return Me._OrderID
        End Get
        Set(ByVal value As Integer)
            If ((Me._OrderID = value) _
               = False) Then
                Me.OnOrderIDChanging(value)
                Me.SendPropertyChanging()
                Me._OrderID = value
                Me.SendPropertyChanged("OrderID")
                Me.OnOrderIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_CustomerID", DbType:="NChar(5)")> _
    Public Property CustomerID() As String
        Get
            Return Me._CustomerID
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._CustomerID, value) = False) Then
                If Me._Customer.HasLoadedOrAssignedValue Then
                    Throw New System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException()
                End If
                Me.OnCustomerIDChanging(value)
                Me.SendPropertyChanging()
                Me._CustomerID = value
                Me.SendPropertyChanged("CustomerID")
                Me.OnCustomerIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_EmployeeID", DbType:="Int")> _
    Public Property EmployeeID() As System.Nullable(Of Integer)
        Get
            Return Me._EmployeeID
        End Get
        Set(ByVal value As System.Nullable(Of Integer))
            If (Me._EmployeeID.Equals(value) = False) Then
                If Me._Employee.HasLoadedOrAssignedValue Then
                    Throw New System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException()
                End If
                Me.OnEmployeeIDChanging(value)
                Me.SendPropertyChanging()
                Me._EmployeeID = value
                Me.SendPropertyChanged("EmployeeID")
                Me.OnEmployeeIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_OrderDate", DbType:="DateTime")> _
    Public Property OrderDate() As System.Nullable(Of Date)
        Get
            Return Me._OrderDate
        End Get
        Set(ByVal value As System.Nullable(Of Date))
            If (Me._OrderDate.Equals(value) = False) Then
                Me.OnOrderDateChanging(value)
                Me.SendPropertyChanging()
                Me._OrderDate = value
                Me.SendPropertyChanged("OrderDate")
                Me.OnOrderDateChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_RequiredDate", DbType:="DateTime")> _
    Public Property RequiredDate() As System.Nullable(Of Date)
        Get
            Return Me._RequiredDate
        End Get
        Set(ByVal value As System.Nullable(Of Date))
            If (Me._RequiredDate.Equals(value) = False) Then
                Me.OnRequiredDateChanging(value)
                Me.SendPropertyChanging()
                Me._RequiredDate = value
                Me.SendPropertyChanged("RequiredDate")
                Me.OnRequiredDateChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_ShippedDate", DbType:="DateTime")> _
    Public Property ShippedDate() As System.Nullable(Of Date)
        Get
            Return Me._ShippedDate
        End Get
        Set(ByVal value As System.Nullable(Of Date))
            If (Me._ShippedDate.Equals(value) = False) Then
                Me.OnShippedDateChanging(value)
                Me.SendPropertyChanging()
                Me._ShippedDate = value
                Me.SendPropertyChanged("ShippedDate")
                Me.OnShippedDateChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_ShipVia", DbType:="Int")> _
    Public Property ShipVia() As System.Nullable(Of Integer)
        Get
            Return Me._ShipVia
        End Get
        Set(ByVal value As System.Nullable(Of Integer))
            If (Me._ShipVia.Equals(value) = False) Then
                If Me._Shipper.HasLoadedOrAssignedValue Then
                    Throw New System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException()
                End If
                Me.OnShipViaChanging(value)
                Me.SendPropertyChanging()
                Me._ShipVia = value
                Me.SendPropertyChanged("ShipVia")
                Me.OnShipViaChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Freight", DbType:="Money")> _
    Public Property Freight() As System.Nullable(Of Decimal)
        Get
            Return Me._Freight
        End Get
        Set(ByVal value As System.Nullable(Of Decimal))
            If (Me._Freight.Equals(value) = False) Then
                Me.OnFreightChanging(value)
                Me.SendPropertyChanging()
                Me._Freight = value
                Me.SendPropertyChanged("Freight")
                Me.OnFreightChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_ShipName", DbType:="NVarChar(40)")> _
    Public Property ShipName() As String
        Get
            Return Me._ShipName
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._ShipName, value) = False) Then
                Me.OnShipNameChanging(value)
                Me.SendPropertyChanging()
                Me._ShipName = value
                Me.SendPropertyChanged("ShipName")
                Me.OnShipNameChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_ShipAddress", DbType:="NVarChar(60)")> _
    Public Property ShipAddress() As String
        Get
            Return Me._ShipAddress
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._ShipAddress, value) = False) Then
                Me.OnShipAddressChanging(value)
                Me.SendPropertyChanging()
                Me._ShipAddress = value
                Me.SendPropertyChanged("ShipAddress")
                Me.OnShipAddressChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_ShipCity", DbType:="NVarChar(15)")> _
    Public Property ShipCity() As String
        Get
            Return Me._ShipCity
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._ShipCity, value) = False) Then
                Me.OnShipCityChanging(value)
                Me.SendPropertyChanging()
                Me._ShipCity = value
                Me.SendPropertyChanged("ShipCity")
                Me.OnShipCityChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_ShipRegion", DbType:="NVarChar(15)")> _
    Public Property ShipRegion() As String
        Get
            Return Me._ShipRegion
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._ShipRegion, value) = False) Then
                Me.OnShipRegionChanging(value)
                Me.SendPropertyChanging()
                Me._ShipRegion = value
                Me.SendPropertyChanged("ShipRegion")
                Me.OnShipRegionChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_ShipPostalCode", DbType:="NVarChar(10)")> _
    Public Property ShipPostalCode() As String
        Get
            Return Me._ShipPostalCode
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._ShipPostalCode, value) = False) Then
                Me.OnShipPostalCodeChanging(value)
                Me.SendPropertyChanging()
                Me._ShipPostalCode = value
                Me.SendPropertyChanged("ShipPostalCode")
                Me.OnShipPostalCodeChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_ShipCountry", DbType:="NVarChar(15)")> _
    Public Property ShipCountry() As String
        Get
            Return Me._ShipCountry
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._ShipCountry, value) = False) Then
                Me.OnShipCountryChanging(value)
                Me.SendPropertyChanging()
                Me._ShipCountry = value
                Me.SendPropertyChanged("ShipCountry")
                Me.OnShipCountryChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Order_Order_Detail", Storage:="_Order_Details", ThisKey:="OrderID", OtherKey:="OrderID")> _
    Public Property Order_Details() As EntitySet(Of Order_Detail)
        Get
            Return Me._Order_Details
        End Get
        Set(ByVal value As EntitySet(Of Order_Detail))
            Me._Order_Details.Assign(value)
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Customer_Order", Storage:="_Customer", ThisKey:="CustomerID", OtherKey:="CustomerID", IsForeignKey:=True)> _
    Public Property Customer() As Customer
        Get
            Return Me._Customer.Entity
        End Get
        Set(ByVal value As Customer)
            Dim previousValue As Customer = Me._Customer.Entity
            If ((Object.Equals(previousValue, value) = False) _
               OrElse (Me._Customer.HasLoadedOrAssignedValue = False)) Then
                Me.SendPropertyChanging()
                If ((previousValue Is Nothing) _
                   = False) Then
                    Me._Customer.Entity = Nothing
                    previousValue.Orders.Remove(Me)
                End If
                Me._Customer.Entity = value
                If ((value Is Nothing) _
                   = False) Then
                    value.Orders.Add(Me)
                    Me._CustomerID = value.CustomerID
                Else
                    Me._CustomerID = CType(Nothing, String)
                End If
                Me.SendPropertyChanged("Customer")
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Employee_Order", Storage:="_Employee", ThisKey:="EmployeeID", OtherKey:="EmployeeID", IsForeignKey:=True)> _
    Public Property Employee() As Employee
        Get
            Return Me._Employee.Entity
        End Get
        Set(ByVal value As Employee)
            Dim previousValue As Employee = Me._Employee.Entity
            If ((Object.Equals(previousValue, value) = False) _
               OrElse (Me._Employee.HasLoadedOrAssignedValue = False)) Then
                Me.SendPropertyChanging()
                If ((previousValue Is Nothing) _
                   = False) Then
                    Me._Employee.Entity = Nothing
                    previousValue.Orders.Remove(Me)
                End If
                Me._Employee.Entity = value
                If ((value Is Nothing) _
                   = False) Then
                    value.Orders.Add(Me)
                    Me._EmployeeID = value.EmployeeID
                Else
                    Me._EmployeeID = CType(Nothing, Nullable(Of Integer))
                End If
                Me.SendPropertyChanged("Employee")
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Shipper_Order", Storage:="_Shipper", ThisKey:="ShipVia", OtherKey:="ShipperID", IsForeignKey:=True)> _
    Public Property Shipper() As Shipper
        Get
            Return Me._Shipper.Entity
        End Get
        Set(ByVal value As Shipper)
            Dim previousValue As Shipper = Me._Shipper.Entity
            If ((Object.Equals(previousValue, value) = False) _
               OrElse (Me._Shipper.HasLoadedOrAssignedValue = False)) Then
                Me.SendPropertyChanging()
                If ((previousValue Is Nothing) _
                   = False) Then
                    Me._Shipper.Entity = Nothing
                    previousValue.Orders.Remove(Me)
                End If
                Me._Shipper.Entity = value
                If ((value Is Nothing) _
                   = False) Then
                    value.Orders.Add(Me)
                    Me._ShipVia = value.ShipperID
                Else
                    Me._ShipVia = CType(Nothing, Nullable(Of Integer))
                End If
                Me.SendPropertyChanged("Shipper")
            End If
        End Set
    End Property

    Public Event PropertyChanging As PropertyChangingEventHandler Implements System.ComponentModel.INotifyPropertyChanging.PropertyChanging

    Public Event PropertyChanged As PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

    Protected Overridable Sub SendPropertyChanging()
        If ((Me.PropertyChangingEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanging(Me, emptyChangingEventArgs)
        End If
    End Sub

    Protected Overridable Sub SendPropertyChanged(ByVal propertyName As [String])
        If ((Me.PropertyChangedEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
        End If
    End Sub

    Private Sub attach_Order_Details(ByVal entity As Order_Detail)
        Me.SendPropertyChanging()
        entity.[Order] = Me
    End Sub

    Private Sub detach_Order_Details(ByVal entity As Order_Detail)
        Me.SendPropertyChanging()
        entity.[Order] = Nothing
    End Sub
End Class

<Global.System.Data.Linq.Mapping.TableAttribute(Name:="dbo.Products")> _
Partial Public Class Product
    Implements System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged

    Private Shared emptyChangingEventArgs As PropertyChangingEventArgs = New PropertyChangingEventArgs(String.Empty)

    Private _ProductID As Integer

    Private _ProductName As String

    Private _SupplierID As System.Nullable(Of Integer)

    Private _CategoryID As System.Nullable(Of Integer)

    Private _QuantityPerUnit As String

    Private _UnitPrice As System.Nullable(Of Decimal)

    Private _UnitsInStock As System.Nullable(Of Short)

    Private _UnitsOnOrder As System.Nullable(Of Short)

    Private _ReorderLevel As System.Nullable(Of Short)

    Private _Discontinued As Boolean

    Private _Order_Details As EntitySet(Of Order_Detail)

    Private _Category As EntityRef(Of Category)

    Private _Supplier As EntityRef(Of Supplier)

#Region "Extensibility Method Definitions"
    Partial Private Sub OnLoaded()
    End Sub
    Partial Private Sub OnValidate(ByVal action As System.Data.Linq.ChangeAction)
    End Sub
    Partial Private Sub OnCreated()
    End Sub
    Partial Private Sub OnProductIDChanging(ByVal value As Integer)
    End Sub
    Partial Private Sub OnProductIDChanged()
    End Sub
    Partial Private Sub OnProductNameChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnProductNameChanged()
    End Sub
    Partial Private Sub OnSupplierIDChanging(ByVal value As System.Nullable(Of Integer))
    End Sub
    Partial Private Sub OnSupplierIDChanged()
    End Sub
    Partial Private Sub OnCategoryIDChanging(ByVal value As System.Nullable(Of Integer))
    End Sub
    Partial Private Sub OnCategoryIDChanged()
    End Sub
    Partial Private Sub OnQuantityPerUnitChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnQuantityPerUnitChanged()
    End Sub
    Partial Private Sub OnUnitPriceChanging(ByVal value As System.Nullable(Of Decimal))
    End Sub
    Partial Private Sub OnUnitPriceChanged()
    End Sub
    Partial Private Sub OnUnitsInStockChanging(ByVal value As System.Nullable(Of Short))
    End Sub
    Partial Private Sub OnUnitsInStockChanged()
    End Sub
    Partial Private Sub OnUnitsOnOrderChanging(ByVal value As System.Nullable(Of Short))
    End Sub
    Partial Private Sub OnUnitsOnOrderChanged()
    End Sub
    Partial Private Sub OnReorderLevelChanging(ByVal value As System.Nullable(Of Short))
    End Sub
    Partial Private Sub OnReorderLevelChanged()
    End Sub
    Partial Private Sub OnDiscontinuedChanging(ByVal value As Boolean)
    End Sub
    Partial Private Sub OnDiscontinuedChanged()
    End Sub
#End Region

    Public Sub New()
        MyBase.New()
        Me._Order_Details = New EntitySet(Of Order_Detail)(AddressOf Me.attach_Order_Details, AddressOf Me.detach_Order_Details)
        Me._Category = CType(Nothing, EntityRef(Of Category))
        Me._Supplier = CType(Nothing, EntityRef(Of Supplier))
        OnCreated()
    End Sub

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_ProductID", AutoSync:=AutoSync.OnInsert, DbType:="Int NOT NULL IDENTITY", IsPrimaryKey:=True, IsDbGenerated:=True)> _
    Public Property ProductID() As Integer
        Get
            Return Me._ProductID
        End Get
        Set(ByVal value As Integer)
            If ((Me._ProductID = value) _
               = False) Then
                Me.OnProductIDChanging(value)
                Me.SendPropertyChanging()
                Me._ProductID = value
                Me.SendPropertyChanged("ProductID")
                Me.OnProductIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_ProductName", DbType:="NVarChar(40) NOT NULL", CanBeNull:=False)> _
    Public Property ProductName() As String
        Get
            Return Me._ProductName
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._ProductName, value) = False) Then
                Me.OnProductNameChanging(value)
                Me.SendPropertyChanging()
                Me._ProductName = value
                Me.SendPropertyChanged("ProductName")
                Me.OnProductNameChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_SupplierID", DbType:="Int")> _
    Public Property SupplierID() As System.Nullable(Of Integer)
        Get
            Return Me._SupplierID
        End Get
        Set(ByVal value As System.Nullable(Of Integer))
            If (Me._SupplierID.Equals(value) = False) Then
                If Me._Supplier.HasLoadedOrAssignedValue Then
                    Throw New System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException()
                End If
                Me.OnSupplierIDChanging(value)
                Me.SendPropertyChanging()
                Me._SupplierID = value
                Me.SendPropertyChanged("SupplierID")
                Me.OnSupplierIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_CategoryID", DbType:="Int")> _
    Public Property CategoryID() As System.Nullable(Of Integer)
        Get
            Return Me._CategoryID
        End Get
        Set(ByVal value As System.Nullable(Of Integer))
            If (Me._CategoryID.Equals(value) = False) Then
                If Me._Category.HasLoadedOrAssignedValue Then
                    Throw New System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException()
                End If
                Me.OnCategoryIDChanging(value)
                Me.SendPropertyChanging()
                Me._CategoryID = value
                Me.SendPropertyChanged("CategoryID")
                Me.OnCategoryIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_QuantityPerUnit", DbType:="NVarChar(20)")> _
    Public Property QuantityPerUnit() As String
        Get
            Return Me._QuantityPerUnit
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._QuantityPerUnit, value) = False) Then
                Me.OnQuantityPerUnitChanging(value)
                Me.SendPropertyChanging()
                Me._QuantityPerUnit = value
                Me.SendPropertyChanged("QuantityPerUnit")
                Me.OnQuantityPerUnitChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_UnitPrice", DbType:="Money")> _
    Public Property UnitPrice() As System.Nullable(Of Decimal)
        Get
            Return Me._UnitPrice
        End Get
        Set(ByVal value As System.Nullable(Of Decimal))
            If (Me._UnitPrice.Equals(value) = False) Then
                Me.OnUnitPriceChanging(value)
                Me.SendPropertyChanging()
                Me._UnitPrice = value
                Me.SendPropertyChanged("UnitPrice")
                Me.OnUnitPriceChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_UnitsInStock", DbType:="SmallInt")> _
    Public Property UnitsInStock() As System.Nullable(Of Short)
        Get
            Return Me._UnitsInStock
        End Get
        Set(ByVal value As System.Nullable(Of Short))
            If (Me._UnitsInStock.Equals(value) = False) Then
                Me.OnUnitsInStockChanging(value)
                Me.SendPropertyChanging()
                Me._UnitsInStock = value
                Me.SendPropertyChanged("UnitsInStock")
                Me.OnUnitsInStockChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_UnitsOnOrder", DbType:="SmallInt")> _
    Public Property UnitsOnOrder() As System.Nullable(Of Short)
        Get
            Return Me._UnitsOnOrder
        End Get
        Set(ByVal value As System.Nullable(Of Short))
            If (Me._UnitsOnOrder.Equals(value) = False) Then
                Me.OnUnitsOnOrderChanging(value)
                Me.SendPropertyChanging()
                Me._UnitsOnOrder = value
                Me.SendPropertyChanged("UnitsOnOrder")
                Me.OnUnitsOnOrderChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_ReorderLevel", DbType:="SmallInt")> _
    Public Property ReorderLevel() As System.Nullable(Of Short)
        Get
            Return Me._ReorderLevel
        End Get
        Set(ByVal value As System.Nullable(Of Short))
            If (Me._ReorderLevel.Equals(value) = False) Then
                Me.OnReorderLevelChanging(value)
                Me.SendPropertyChanging()
                Me._ReorderLevel = value
                Me.SendPropertyChanged("ReorderLevel")
                Me.OnReorderLevelChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Discontinued", DbType:="Bit NOT NULL")> _
    Public Property Discontinued() As Boolean
        Get
            Return Me._Discontinued
        End Get
        Set(ByVal value As Boolean)
            If ((Me._Discontinued = value) _
               = False) Then
                Me.OnDiscontinuedChanging(value)
                Me.SendPropertyChanging()
                Me._Discontinued = value
                Me.SendPropertyChanged("Discontinued")
                Me.OnDiscontinuedChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Product_Order_Detail", Storage:="_Order_Details", ThisKey:="ProductID", OtherKey:="ProductID")> _
    Public Property Order_Details() As EntitySet(Of Order_Detail)
        Get
            Return Me._Order_Details
        End Get
        Set(ByVal value As EntitySet(Of Order_Detail))
            Me._Order_Details.Assign(value)
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Category_Product", Storage:="_Category", ThisKey:="CategoryID", OtherKey:="CategoryID", IsForeignKey:=True)> _
    Public Property Category() As Category
        Get
            Return Me._Category.Entity
        End Get
        Set(ByVal value As Category)
            Dim previousValue As Category = Me._Category.Entity
            If ((Object.Equals(previousValue, value) = False) _
               OrElse (Me._Category.HasLoadedOrAssignedValue = False)) Then
                Me.SendPropertyChanging()
                If ((previousValue Is Nothing) _
                   = False) Then
                    Me._Category.Entity = Nothing
                    previousValue.Products.Remove(Me)
                End If
                Me._Category.Entity = value
                If ((value Is Nothing) _
                   = False) Then
                    value.Products.Add(Me)
                    Me._CategoryID = value.CategoryID
                Else
                    Me._CategoryID = CType(Nothing, Nullable(Of Integer))
                End If
                Me.SendPropertyChanged("Category")
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Supplier_Product", Storage:="_Supplier", ThisKey:="SupplierID", OtherKey:="SupplierID", IsForeignKey:=True)> _
    Public Property Supplier() As Supplier
        Get
            Return Me._Supplier.Entity
        End Get
        Set(ByVal value As Supplier)
            Dim previousValue As Supplier = Me._Supplier.Entity
            If ((Object.Equals(previousValue, value) = False) _
               OrElse (Me._Supplier.HasLoadedOrAssignedValue = False)) Then
                Me.SendPropertyChanging()
                If ((previousValue Is Nothing) _
                   = False) Then
                    Me._Supplier.Entity = Nothing
                    previousValue.Products.Remove(Me)
                End If
                Me._Supplier.Entity = value
                If ((value Is Nothing) _
                   = False) Then
                    value.Products.Add(Me)
                    Me._SupplierID = value.SupplierID
                Else
                    Me._SupplierID = CType(Nothing, Nullable(Of Integer))
                End If
                Me.SendPropertyChanged("Supplier")
            End If
        End Set
    End Property

    Public Event PropertyChanging As PropertyChangingEventHandler Implements System.ComponentModel.INotifyPropertyChanging.PropertyChanging

    Public Event PropertyChanged As PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

    Protected Overridable Sub SendPropertyChanging()
        If ((Me.PropertyChangingEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanging(Me, emptyChangingEventArgs)
        End If
    End Sub

    Protected Overridable Sub SendPropertyChanged(ByVal propertyName As [String])
        If ((Me.PropertyChangedEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
        End If
    End Sub

    Private Sub attach_Order_Details(ByVal entity As Order_Detail)
        Me.SendPropertyChanging()
        entity.Product = Me
    End Sub

    Private Sub detach_Order_Details(ByVal entity As Order_Detail)
        Me.SendPropertyChanging()
        entity.Product = Nothing
    End Sub
End Class

<Global.System.Data.Linq.Mapping.TableAttribute(Name:="dbo.Region")> _
Partial Public Class Region
    Implements System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged

    Private Shared emptyChangingEventArgs As PropertyChangingEventArgs = New PropertyChangingEventArgs(String.Empty)

    Private _RegionID As Integer

    Private _RegionDescription As String

    Private _Territories As EntitySet(Of Territory)

#Region "Extensibility Method Definitions"
    Partial Private Sub OnLoaded()
    End Sub
    Partial Private Sub OnValidate(ByVal action As System.Data.Linq.ChangeAction)
    End Sub
    Partial Private Sub OnCreated()
    End Sub
    Partial Private Sub OnRegionIDChanging(ByVal value As Integer)
    End Sub
    Partial Private Sub OnRegionIDChanged()
    End Sub
    Partial Private Sub OnRegionDescriptionChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnRegionDescriptionChanged()
    End Sub
#End Region

    Public Sub New()
        MyBase.New()
        Me._Territories = New EntitySet(Of Territory)(AddressOf Me.attach_Territories, AddressOf Me.detach_Territories)
        OnCreated()
    End Sub

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_RegionID", DbType:="Int NOT NULL", IsPrimaryKey:=True)> _
    Public Property RegionID() As Integer
        Get
            Return Me._RegionID
        End Get
        Set(ByVal value As Integer)
            If ((Me._RegionID = value) _
               = False) Then
                Me.OnRegionIDChanging(value)
                Me.SendPropertyChanging()
                Me._RegionID = value
                Me.SendPropertyChanged("RegionID")
                Me.OnRegionIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_RegionDescription", DbType:="NChar(50) NOT NULL", CanBeNull:=False)> _
    Public Property RegionDescription() As String
        Get
            Return Me._RegionDescription
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._RegionDescription, value) = False) Then
                Me.OnRegionDescriptionChanging(value)
                Me.SendPropertyChanging()
                Me._RegionDescription = value
                Me.SendPropertyChanged("RegionDescription")
                Me.OnRegionDescriptionChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Region_Territory", Storage:="_Territories", ThisKey:="RegionID", OtherKey:="RegionID")> _
    Public Property Territories() As EntitySet(Of Territory)
        Get
            Return Me._Territories
        End Get
        Set(ByVal value As EntitySet(Of Territory))
            Me._Territories.Assign(value)
        End Set
    End Property

    Public Event PropertyChanging As PropertyChangingEventHandler Implements System.ComponentModel.INotifyPropertyChanging.PropertyChanging

    Public Event PropertyChanged As PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

    Protected Overridable Sub SendPropertyChanging()
        If ((Me.PropertyChangingEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanging(Me, emptyChangingEventArgs)
        End If
    End Sub

    Protected Overridable Sub SendPropertyChanged(ByVal propertyName As [String])
        If ((Me.PropertyChangedEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
        End If
    End Sub

    Private Sub attach_Territories(ByVal entity As Territory)
        Me.SendPropertyChanging()
        entity.Region = Me
    End Sub

    Private Sub detach_Territories(ByVal entity As Territory)
        Me.SendPropertyChanging()
        entity.Region = Nothing
    End Sub
End Class

<Global.System.Data.Linq.Mapping.TableAttribute(Name:="dbo.Shippers")> _
Partial Public Class Shipper
    Implements System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged

    Private Shared emptyChangingEventArgs As PropertyChangingEventArgs = New PropertyChangingEventArgs(String.Empty)

    Private _ShipperID As Integer

    Private _CompanyName As String

    Private _Phone As String

    Private _Orders As EntitySet(Of [Order])

#Region "Extensibility Method Definitions"
    Partial Private Sub OnLoaded()
    End Sub
    Partial Private Sub OnValidate(ByVal action As System.Data.Linq.ChangeAction)
    End Sub
    Partial Private Sub OnCreated()
    End Sub
    Partial Private Sub OnShipperIDChanging(ByVal value As Integer)
    End Sub
    Partial Private Sub OnShipperIDChanged()
    End Sub
    Partial Private Sub OnCompanyNameChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnCompanyNameChanged()
    End Sub
    Partial Private Sub OnPhoneChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnPhoneChanged()
    End Sub
#End Region

    Public Sub New()
        MyBase.New()
        Me._Orders = New EntitySet(Of [Order])(AddressOf Me.attach_Orders, AddressOf Me.detach_Orders)
        OnCreated()
    End Sub

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_ShipperID", AutoSync:=AutoSync.OnInsert, DbType:="Int NOT NULL IDENTITY", IsPrimaryKey:=True, IsDbGenerated:=True)> _
    Public Property ShipperID() As Integer
        Get
            Return Me._ShipperID
        End Get
        Set(ByVal value As Integer)
            If ((Me._ShipperID = value) _
               = False) Then
                Me.OnShipperIDChanging(value)
                Me.SendPropertyChanging()
                Me._ShipperID = value
                Me.SendPropertyChanged("ShipperID")
                Me.OnShipperIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_CompanyName", DbType:="NVarChar(40) NOT NULL", CanBeNull:=False)> _
    Public Property CompanyName() As String
        Get
            Return Me._CompanyName
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._CompanyName, value) = False) Then
                Me.OnCompanyNameChanging(value)
                Me.SendPropertyChanging()
                Me._CompanyName = value
                Me.SendPropertyChanged("CompanyName")
                Me.OnCompanyNameChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Phone", DbType:="NVarChar(24)")> _
    Public Property Phone() As String
        Get
            Return Me._Phone
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._Phone, value) = False) Then
                Me.OnPhoneChanging(value)
                Me.SendPropertyChanging()
                Me._Phone = value
                Me.SendPropertyChanged("Phone")
                Me.OnPhoneChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Shipper_Order", Storage:="_Orders", ThisKey:="ShipperID", OtherKey:="ShipVia")> _
    Public Property Orders() As EntitySet(Of [Order])
        Get
            Return Me._Orders
        End Get
        Set(ByVal value As EntitySet(Of [Order]))
            Me._Orders.Assign(value)
        End Set
    End Property

    Public Event PropertyChanging As PropertyChangingEventHandler Implements System.ComponentModel.INotifyPropertyChanging.PropertyChanging

    Public Event PropertyChanged As PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

    Protected Overridable Sub SendPropertyChanging()
        If ((Me.PropertyChangingEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanging(Me, emptyChangingEventArgs)
        End If
    End Sub

    Protected Overridable Sub SendPropertyChanged(ByVal propertyName As [String])
        If ((Me.PropertyChangedEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
        End If
    End Sub

    Private Sub attach_Orders(ByVal entity As [Order])
        Me.SendPropertyChanging()
        entity.Shipper = Me
    End Sub

    Private Sub detach_Orders(ByVal entity As [Order])
        Me.SendPropertyChanging()
        entity.Shipper = Nothing
    End Sub
End Class

<Global.System.Data.Linq.Mapping.TableAttribute(Name:="dbo.Suppliers")> _
Partial Public Class Supplier
    Implements System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged

    Private Shared emptyChangingEventArgs As PropertyChangingEventArgs = New PropertyChangingEventArgs(String.Empty)

    Private _SupplierID As Integer

    Private _CompanyName As String

    Private _ContactName As String

    Private _ContactTitle As String

    Private _Address As String

    Private _City As String

    Private _Region As String

    Private _PostalCode As String

    Private _Country As String

    Private _Phone As String

    Private _Fax As String

    Private _HomePage As String

    Private _Products As EntitySet(Of Product)

#Region "Extensibility Method Definitions"
    Partial Private Sub OnLoaded()
    End Sub
    Partial Private Sub OnValidate(ByVal action As System.Data.Linq.ChangeAction)
    End Sub
    Partial Private Sub OnCreated()
    End Sub
    Partial Private Sub OnSupplierIDChanging(ByVal value As Integer)
    End Sub
    Partial Private Sub OnSupplierIDChanged()
    End Sub
    Partial Private Sub OnCompanyNameChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnCompanyNameChanged()
    End Sub
    Partial Private Sub OnContactNameChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnContactNameChanged()
    End Sub
    Partial Private Sub OnContactTitleChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnContactTitleChanged()
    End Sub
    Partial Private Sub OnAddressChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnAddressChanged()
    End Sub
    Partial Private Sub OnCityChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnCityChanged()
    End Sub
    Partial Private Sub OnRegionChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnRegionChanged()
    End Sub
    Partial Private Sub OnPostalCodeChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnPostalCodeChanged()
    End Sub
    Partial Private Sub OnCountryChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnCountryChanged()
    End Sub
    Partial Private Sub OnPhoneChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnPhoneChanged()
    End Sub
    Partial Private Sub OnFaxChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnFaxChanged()
    End Sub
    Partial Private Sub OnHomePageChanging(ByVal value As String)
    End Sub
    Partial Private Sub OnHomePageChanged()
    End Sub
#End Region

    Public Sub New()
        MyBase.New()
        Me._Products = New EntitySet(Of Product)(AddressOf Me.attach_Products, AddressOf Me.detach_Products)
        OnCreated()
    End Sub

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_SupplierID", AutoSync:=AutoSync.OnInsert, DbType:="Int NOT NULL IDENTITY", IsPrimaryKey:=True, IsDbGenerated:=True)> _
    Public Property SupplierID() As Integer
        Get
            Return Me._SupplierID
        End Get
        Set(ByVal value As Integer)
            If ((Me._SupplierID = value) _
               = False) Then
                Me.OnSupplierIDChanging(value)
                Me.SendPropertyChanging()
                Me._SupplierID = value
                Me.SendPropertyChanged("SupplierID")
                Me.OnSupplierIDChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_CompanyName", DbType:="NVarChar(40) NOT NULL", CanBeNull:=False)> _
    Public Property CompanyName() As String
        Get
            Return Me._CompanyName
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._CompanyName, value) = False) Then
                Me.OnCompanyNameChanging(value)
                Me.SendPropertyChanging()
                Me._CompanyName = value
                Me.SendPropertyChanged("CompanyName")
                Me.OnCompanyNameChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_ContactName", DbType:="NVarChar(30)")> _
    Public Property ContactName() As String
        Get
            Return Me._ContactName
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._ContactName, value) = False) Then
                Me.OnContactNameChanging(value)
                Me.SendPropertyChanging()
                Me._ContactName = value
                Me.SendPropertyChanged("ContactName")
                Me.OnContactNameChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_ContactTitle", DbType:="NVarChar(30)")> _
    Public Property ContactTitle() As String
        Get
            Return Me._ContactTitle
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._ContactTitle, value) = False) Then
                Me.OnContactTitleChanging(value)
                Me.SendPropertyChanging()
                Me._ContactTitle = value
                Me.SendPropertyChanged("ContactTitle")
                Me.OnContactTitleChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Address", DbType:="NVarChar(60)")> _
    Public Property Address() As String
        Get
            Return Me._Address
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._Address, value) = False) Then
                Me.OnAddressChanging(value)
                Me.SendPropertyChanging()
                Me._Address = value
                Me.SendPropertyChanged("Address")
                Me.OnAddressChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_City", DbType:="NVarChar(15)")> _
    Public Property City() As String
        Get
            Return Me._City
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._City, value) = False) Then
                Me.OnCityChanging(value)
                Me.SendPropertyChanging()
                Me._City = value
                Me.SendPropertyChanged("City")
                Me.OnCityChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Region", DbType:="NVarChar(15)")> _
    Public Property Region() As String
        Get
            Return Me._Region
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._Region, value) = False) Then
                Me.OnRegionChanging(value)
                Me.SendPropertyChanging()
                Me._Region = value
                Me.SendPropertyChanged("Region")
                Me.OnRegionChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_PostalCode", DbType:="NVarChar(10)")> _
    Public Property PostalCode() As String
        Get
            Return Me._PostalCode
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._PostalCode, value) = False) Then
                Me.OnPostalCodeChanging(value)
                Me.SendPropertyChanging()
                Me._PostalCode = value
                Me.SendPropertyChanged("PostalCode")
                Me.OnPostalCodeChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Country", DbType:="NVarChar(15)")> _
    Public Property Country() As String
        Get
            Return Me._Country
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._Country, value) = False) Then
                Me.OnCountryChanging(value)
                Me.SendPropertyChanging()
                Me._Country = value
                Me.SendPropertyChanged("Country")
                Me.OnCountryChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Phone", DbType:="NVarChar(24)")> _
    Public Property Phone() As String
        Get
            Return Me._Phone
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._Phone, value) = False) Then
                Me.OnPhoneChanging(value)
                Me.SendPropertyChanging()
                Me._Phone = value
                Me.SendPropertyChanged("Phone")
                Me.OnPhoneChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Fax", DbType:="NVarChar(24)")> _
    Public Property Fax() As String
        Get
            Return Me._Fax
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._Fax, value) = False) Then
                Me.OnFaxChanging(value)
                Me.SendPropertyChanging()
                Me._Fax = value
                Me.SendPropertyChanged("Fax")
                Me.OnFaxChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_HomePage", DbType:="NText", UpdateCheck:=UpdateCheck.Never)> _
    Public Property HomePage() As String
        Get
            Return Me._HomePage
        End Get
        Set(ByVal value As String)
            If (String.Equals(Me._HomePage, value) = False) Then
                Me.OnHomePageChanging(value)
                Me.SendPropertyChanging()
                Me._HomePage = value
                Me.SendPropertyChanged("HomePage")
                Me.OnHomePageChanged()
            End If
        End Set
    End Property

    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Supplier_Product", Storage:="_Products", ThisKey:="SupplierID", OtherKey:="SupplierID")> _
    Public Property Products() As EntitySet(Of Product)
        Get
            Return Me._Products
        End Get
        Set(ByVal value As EntitySet(Of Product))
            Me._Products.Assign(value)
        End Set
    End Property

    Public Event PropertyChanging As PropertyChangingEventHandler Implements System.ComponentModel.INotifyPropertyChanging.PropertyChanging

    Public Event PropertyChanged As PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

    Protected Overridable Sub SendPropertyChanging()
        If ((Me.PropertyChangingEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanging(Me, emptyChangingEventArgs)
        End If
    End Sub

    Protected Overridable Sub SendPropertyChanged(ByVal propertyName As [String])
        If ((Me.PropertyChangedEvent Is Nothing) _
           = False) Then
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
        End If
    End Sub

    Private Sub attach_Products(ByVal entity As Product)
        Me.SendPropertyChanging()
        entity.Supplier = Me
    End Sub

    Private Sub detach_Products(ByVal entity As Product)
        Me.SendPropertyChanging()
        entity.Supplier = Nothing
    End Sub
End Class
