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

Imports System
Imports System.ComponentModel
Imports System.Data.EntityClient
Imports System.Data.Objects
Imports System.Data.Objects.DataClasses
Imports System.Linq
Imports System.Runtime.Serialization
Imports System.Xml.Serialization


<Assembly: EdmSchemaAttribute("295b6d76-5ab7-435a-b28e-007c3913ebed")>
#Region "EDM Relationship Metadata"
<Assembly: EdmRelationshipAttribute("NORTHWNDModel", "FK_Orders_Customers", "Customers", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, GetType(NORTHWNDModel.Customer), "Orders", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, GetType(NORTHWNDModel.Order), True)>
<Assembly: EdmRelationshipAttribute("NORTHWNDModel", "FK_Order_Details_Orders", "Orders", System.Data.Metadata.Edm.RelationshipMultiplicity.One, GetType(NORTHWNDModel.Order), "Order_Details", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, GetType(NORTHWNDModel.Order_Detail), True)>

#End Region

Namespace NORTHWNDModel

    #Region "Contexts"
    
    ''' <summary>
    ''' No Metadata Documentation available.
    ''' </summary>
    Public Partial Class NORTHWNDEntities
        Inherits ObjectContext
    
        #Region "Constructors"
    
        ''' <summary>
        ''' Initializes a new NORTHWNDEntities object using the connection string found in the 'NORTHWNDEntities' section of the application configuration file.
        ''' </summary>
        Public Sub New()
            MyBase.New("name=NORTHWNDEntities", "NORTHWNDEntities")
            MyBase.ContextOptions.LazyLoadingEnabled = true
            OnContextCreated()
        End Sub
    
        ''' <summary>
        ''' Initialize a new NORTHWNDEntities object.
        ''' </summary>
        Public Sub New(ByVal connectionString As String)
            MyBase.New(connectionString, "NORTHWNDEntities")
            MyBase.ContextOptions.LazyLoadingEnabled = true
            OnContextCreated()
        End Sub
    
        ''' <summary>
        ''' Initialize a new NORTHWNDEntities object.
        ''' </summary>
        Public Sub New(ByVal connection As EntityConnection)
            MyBase.New(connection, "NORTHWNDEntities")
            MyBase.ContextOptions.LazyLoadingEnabled = true
            OnContextCreated()
        End Sub
    
        #End Region
    
        #Region "Partial Methods"
    
        Partial Private Sub OnContextCreated()
        End Sub
    
        #End Region
    
        #Region "ObjectSet Properties"
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        Public ReadOnly Property Customers() As ObjectSet(Of Customer)
            Get
                If (_Customers Is Nothing) Then
                    _Customers = MyBase.CreateObjectSet(Of Customer)("Customers")
                End If
                Return _Customers
            End Get
        End Property
    
        Private _Customers As ObjectSet(Of Customer)
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        Public ReadOnly Property Order_Details() As ObjectSet(Of Order_Detail)
            Get
                If (_Order_Details Is Nothing) Then
                    _Order_Details = MyBase.CreateObjectSet(Of Order_Detail)("Order_Details")
                End If
                Return _Order_Details
            End Get
        End Property
    
        Private _Order_Details As ObjectSet(Of Order_Detail)
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        Public ReadOnly Property Orders() As ObjectSet(Of Order)
            Get
                If (_Orders Is Nothing) Then
                    _Orders = MyBase.CreateObjectSet(Of Order)("Orders")
                End If
                Return _Orders
            End Get
        End Property
    
        Private _Orders As ObjectSet(Of Order)

        #End Region

        #Region "AddTo Methods"
    
        ''' <summary>
        ''' Deprecated Method for adding a new object to the Customers EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
        ''' </summary>
        Public Sub AddToCustomers(ByVal customer As Customer)
            MyBase.AddObject("Customers", customer)
        End Sub
    
        ''' <summary>
        ''' Deprecated Method for adding a new object to the Order_Details EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
        ''' </summary>
        Public Sub AddToOrder_Details(ByVal order_Detail As Order_Detail)
            MyBase.AddObject("Order_Details", order_Detail)
        End Sub
    
        ''' <summary>
        ''' Deprecated Method for adding a new object to the Orders EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
        ''' </summary>
        Public Sub AddToOrders(ByVal order As Order)
            MyBase.AddObject("Orders", order)
        End Sub

        #End Region

    End Class

    #End Region

    #Region "Entities"
    
    ''' <summary>
    ''' No Metadata Documentation available.
    ''' </summary>
    <EdmEntityTypeAttribute(NamespaceName:="NORTHWNDModel", Name:="Customer")>
    <Serializable()>
    <DataContractAttribute(IsReference:=True)>
    Public Partial Class Customer
        Inherits EntityObject
        #Region "Factory Method"
    
        ''' <summary>
        ''' Create a new Customer object.
        ''' </summary>
        ''' <param name="customerID">Initial value of the CustomerID property.</param>
        ''' <param name="companyName">Initial value of the CompanyName property.</param>
        Public Shared Function CreateCustomer(customerID As Global.System.String, companyName As Global.System.String) As Customer
            Dim customer as Customer = New Customer
            customer.CustomerID = customerID
            customer.CompanyName = companyName
            Return customer
        End Function

        #End Region

        #Region "Primitive Properties"
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property CustomerID() As Global.System.String
            Get
                Return _CustomerID
            End Get
            Set
                If (_CustomerID <> Value) Then
                    OnCustomerIDChanging(value)
                    ReportPropertyChanging("CustomerID")
                    _CustomerID = StructuralObject.SetValidValue(value, false)
                    ReportPropertyChanged("CustomerID")
                    OnCustomerIDChanged()
                End If
            End Set
        End Property
    
        Private _CustomerID As Global.System.String
        Private Partial Sub OnCustomerIDChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnCustomerIDChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property CompanyName() As Global.System.String
            Get
                Return _CompanyName
            End Get
            Set
                OnCompanyNameChanging(value)
                ReportPropertyChanging("CompanyName")
                _CompanyName = StructuralObject.SetValidValue(value, false)
                ReportPropertyChanged("CompanyName")
                OnCompanyNameChanged()
            End Set
        End Property
    
        Private _CompanyName As Global.System.String
        Private Partial Sub OnCompanyNameChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnCompanyNameChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property ContactName() As Global.System.String
            Get
                Return _ContactName
            End Get
            Set
                OnContactNameChanging(value)
                ReportPropertyChanging("ContactName")
                _ContactName = StructuralObject.SetValidValue(value, true)
                ReportPropertyChanged("ContactName")
                OnContactNameChanged()
            End Set
        End Property
    
        Private _ContactName As Global.System.String
        Private Partial Sub OnContactNameChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnContactNameChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property ContactTitle() As Global.System.String
            Get
                Return _ContactTitle
            End Get
            Set
                OnContactTitleChanging(value)
                ReportPropertyChanging("ContactTitle")
                _ContactTitle = StructuralObject.SetValidValue(value, true)
                ReportPropertyChanged("ContactTitle")
                OnContactTitleChanged()
            End Set
        End Property
    
        Private _ContactTitle As Global.System.String
        Private Partial Sub OnContactTitleChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnContactTitleChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property Address() As Global.System.String
            Get
                Return _Address
            End Get
            Set
                OnAddressChanging(value)
                ReportPropertyChanging("Address")
                _Address = StructuralObject.SetValidValue(value, true)
                ReportPropertyChanged("Address")
                OnAddressChanged()
            End Set
        End Property
    
        Private _Address As Global.System.String
        Private Partial Sub OnAddressChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnAddressChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property City() As Global.System.String
            Get
                Return _City
            End Get
            Set
                OnCityChanging(value)
                ReportPropertyChanging("City")
                _City = StructuralObject.SetValidValue(value, true)
                ReportPropertyChanged("City")
                OnCityChanged()
            End Set
        End Property
    
        Private _City As Global.System.String
        Private Partial Sub OnCityChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnCityChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property Region() As Global.System.String
            Get
                Return _Region
            End Get
            Set
                OnRegionChanging(value)
                ReportPropertyChanging("Region")
                _Region = StructuralObject.SetValidValue(value, true)
                ReportPropertyChanged("Region")
                OnRegionChanged()
            End Set
        End Property
    
        Private _Region As Global.System.String
        Private Partial Sub OnRegionChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnRegionChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property PostalCode() As Global.System.String
            Get
                Return _PostalCode
            End Get
            Set
                OnPostalCodeChanging(value)
                ReportPropertyChanging("PostalCode")
                _PostalCode = StructuralObject.SetValidValue(value, true)
                ReportPropertyChanged("PostalCode")
                OnPostalCodeChanged()
            End Set
        End Property
    
        Private _PostalCode As Global.System.String
        Private Partial Sub OnPostalCodeChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnPostalCodeChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property Country() As Global.System.String
            Get
                Return _Country
            End Get
            Set
                OnCountryChanging(value)
                ReportPropertyChanging("Country")
                _Country = StructuralObject.SetValidValue(value, true)
                ReportPropertyChanged("Country")
                OnCountryChanged()
            End Set
        End Property
    
        Private _Country As Global.System.String
        Private Partial Sub OnCountryChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnCountryChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property Phone() As Global.System.String
            Get
                Return _Phone
            End Get
            Set
                OnPhoneChanging(value)
                ReportPropertyChanging("Phone")
                _Phone = StructuralObject.SetValidValue(value, true)
                ReportPropertyChanged("Phone")
                OnPhoneChanged()
            End Set
        End Property
    
        Private _Phone As Global.System.String
        Private Partial Sub OnPhoneChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnPhoneChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property Fax() As Global.System.String
            Get
                Return _Fax
            End Get
            Set
                OnFaxChanging(value)
                ReportPropertyChanging("Fax")
                _Fax = StructuralObject.SetValidValue(value, true)
                ReportPropertyChanged("Fax")
                OnFaxChanged()
            End Set
        End Property
    
        Private _Fax As Global.System.String
        Private Partial Sub OnFaxChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnFaxChanged()
        End Sub

        #End Region

        #Region "Navigation Properties"
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <XmlIgnoreAttribute()>
        <SoapIgnoreAttribute()>
        <DataMemberAttribute()>
        <EdmRelationshipNavigationPropertyAttribute("NORTHWNDModel", "FK_Orders_Customers", "Orders")>
         Public Property Orders() As EntityCollection(Of Order)
            Get
                Return CType(Me,IEntityWithRelationships).RelationshipManager.GetRelatedCollection(Of Order)("NORTHWNDModel.FK_Orders_Customers", "Orders")
            End Get
            Set
                If (Not value Is Nothing)
                    CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedCollection(Of Order)("NORTHWNDModel.FK_Orders_Customers", "Orders", value)
                End If
            End Set
        End Property

        #End Region

    End Class
    
    ''' <summary>
    ''' No Metadata Documentation available.
    ''' </summary>
    <EdmEntityTypeAttribute(NamespaceName:="NORTHWNDModel", Name:="Order")>
    <Serializable()>
    <DataContractAttribute(IsReference:=True)>
    Public Partial Class Order
        Inherits EntityObject
        #Region "Factory Method"
    
        ''' <summary>
        ''' Create a new Order object.
        ''' </summary>
        ''' <param name="orderID">Initial value of the OrderID property.</param>
        Public Shared Function CreateOrder(orderID As Global.System.Int32) As Order
            Dim order as Order = New Order
            order.OrderID = orderID
            Return order
        End Function

        #End Region

        #Region "Primitive Properties"
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property OrderID() As Global.System.Int32
            Get
                Return _OrderID
            End Get
            Set
                If (_OrderID <> Value) Then
                    OnOrderIDChanging(value)
                    ReportPropertyChanging("OrderID")
                    _OrderID = StructuralObject.SetValidValue(value)
                    ReportPropertyChanged("OrderID")
                    OnOrderIDChanged()
                End If
            End Set
        End Property
    
        Private _OrderID As Global.System.Int32
        Private Partial Sub OnOrderIDChanging(value As Global.System.Int32)
        End Sub
    
        Private Partial Sub OnOrderIDChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property CustomerID() As Global.System.String
            Get
                Return _CustomerID
            End Get
            Set
                OnCustomerIDChanging(value)
                ReportPropertyChanging("CustomerID")
                _CustomerID = StructuralObject.SetValidValue(value, true)
                ReportPropertyChanged("CustomerID")
                OnCustomerIDChanged()
            End Set
        End Property
    
        Private _CustomerID As Global.System.String
        Private Partial Sub OnCustomerIDChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnCustomerIDChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property EmployeeID() As Nullable(Of Global.System.Int32)
            Get
                Return _EmployeeID
            End Get
            Set
                OnEmployeeIDChanging(value)
                ReportPropertyChanging("EmployeeID")
                _EmployeeID = StructuralObject.SetValidValue(value)
                ReportPropertyChanged("EmployeeID")
                OnEmployeeIDChanged()
            End Set
        End Property
    
        Private _EmployeeID As Nullable(Of Global.System.Int32)
        Private Partial Sub OnEmployeeIDChanging(value As Nullable(Of Global.System.Int32))
        End Sub
    
        Private Partial Sub OnEmployeeIDChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property OrderDate() As Nullable(Of Global.System.DateTime)
            Get
                Return _OrderDate
            End Get
            Set
                OnOrderDateChanging(value)
                ReportPropertyChanging("OrderDate")
                _OrderDate = StructuralObject.SetValidValue(value)
                ReportPropertyChanged("OrderDate")
                OnOrderDateChanged()
            End Set
        End Property
    
        Private _OrderDate As Nullable(Of Global.System.DateTime)
        Private Partial Sub OnOrderDateChanging(value As Nullable(Of Global.System.DateTime))
        End Sub
    
        Private Partial Sub OnOrderDateChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property RequiredDate() As Nullable(Of Global.System.DateTime)
            Get
                Return _RequiredDate
            End Get
            Set
                OnRequiredDateChanging(value)
                ReportPropertyChanging("RequiredDate")
                _RequiredDate = StructuralObject.SetValidValue(value)
                ReportPropertyChanged("RequiredDate")
                OnRequiredDateChanged()
            End Set
        End Property
    
        Private _RequiredDate As Nullable(Of Global.System.DateTime)
        Private Partial Sub OnRequiredDateChanging(value As Nullable(Of Global.System.DateTime))
        End Sub
    
        Private Partial Sub OnRequiredDateChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property ShippedDate() As Nullable(Of Global.System.DateTime)
            Get
                Return _ShippedDate
            End Get
            Set
                OnShippedDateChanging(value)
                ReportPropertyChanging("ShippedDate")
                _ShippedDate = StructuralObject.SetValidValue(value)
                ReportPropertyChanged("ShippedDate")
                OnShippedDateChanged()
            End Set
        End Property
    
        Private _ShippedDate As Nullable(Of Global.System.DateTime)
        Private Partial Sub OnShippedDateChanging(value As Nullable(Of Global.System.DateTime))
        End Sub
    
        Private Partial Sub OnShippedDateChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property ShipVia() As Nullable(Of Global.System.Int32)
            Get
                Return _ShipVia
            End Get
            Set
                OnShipViaChanging(value)
                ReportPropertyChanging("ShipVia")
                _ShipVia = StructuralObject.SetValidValue(value)
                ReportPropertyChanged("ShipVia")
                OnShipViaChanged()
            End Set
        End Property
    
        Private _ShipVia As Nullable(Of Global.System.Int32)
        Private Partial Sub OnShipViaChanging(value As Nullable(Of Global.System.Int32))
        End Sub
    
        Private Partial Sub OnShipViaChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property Freight() As Nullable(Of Global.System.Decimal)
            Get
                Return _Freight
            End Get
            Set
                OnFreightChanging(value)
                ReportPropertyChanging("Freight")
                _Freight = StructuralObject.SetValidValue(value)
                ReportPropertyChanged("Freight")
                OnFreightChanged()
            End Set
        End Property
    
        Private _Freight As Nullable(Of Global.System.Decimal)
        Private Partial Sub OnFreightChanging(value As Nullable(Of Global.System.Decimal))
        End Sub
    
        Private Partial Sub OnFreightChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property ShipName() As Global.System.String
            Get
                Return _ShipName
            End Get
            Set
                OnShipNameChanging(value)
                ReportPropertyChanging("ShipName")
                _ShipName = StructuralObject.SetValidValue(value, true)
                ReportPropertyChanged("ShipName")
                OnShipNameChanged()
            End Set
        End Property
    
        Private _ShipName As Global.System.String
        Private Partial Sub OnShipNameChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnShipNameChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property ShipAddress() As Global.System.String
            Get
                Return _ShipAddress
            End Get
            Set
                OnShipAddressChanging(value)
                ReportPropertyChanging("ShipAddress")
                _ShipAddress = StructuralObject.SetValidValue(value, true)
                ReportPropertyChanged("ShipAddress")
                OnShipAddressChanged()
            End Set
        End Property
    
        Private _ShipAddress As Global.System.String
        Private Partial Sub OnShipAddressChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnShipAddressChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property ShipCity() As Global.System.String
            Get
                Return _ShipCity
            End Get
            Set
                OnShipCityChanging(value)
                ReportPropertyChanging("ShipCity")
                _ShipCity = StructuralObject.SetValidValue(value, true)
                ReportPropertyChanged("ShipCity")
                OnShipCityChanged()
            End Set
        End Property
    
        Private _ShipCity As Global.System.String
        Private Partial Sub OnShipCityChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnShipCityChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property ShipRegion() As Global.System.String
            Get
                Return _ShipRegion
            End Get
            Set
                OnShipRegionChanging(value)
                ReportPropertyChanging("ShipRegion")
                _ShipRegion = StructuralObject.SetValidValue(value, true)
                ReportPropertyChanged("ShipRegion")
                OnShipRegionChanged()
            End Set
        End Property
    
        Private _ShipRegion As Global.System.String
        Private Partial Sub OnShipRegionChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnShipRegionChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property ShipPostalCode() As Global.System.String
            Get
                Return _ShipPostalCode
            End Get
            Set
                OnShipPostalCodeChanging(value)
                ReportPropertyChanging("ShipPostalCode")
                _ShipPostalCode = StructuralObject.SetValidValue(value, true)
                ReportPropertyChanged("ShipPostalCode")
                OnShipPostalCodeChanged()
            End Set
        End Property
    
        Private _ShipPostalCode As Global.System.String
        Private Partial Sub OnShipPostalCodeChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnShipPostalCodeChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property ShipCountry() As Global.System.String
            Get
                Return _ShipCountry
            End Get
            Set
                OnShipCountryChanging(value)
                ReportPropertyChanging("ShipCountry")
                _ShipCountry = StructuralObject.SetValidValue(value, true)
                ReportPropertyChanged("ShipCountry")
                OnShipCountryChanged()
            End Set
        End Property
    
        Private _ShipCountry As Global.System.String
        Private Partial Sub OnShipCountryChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnShipCountryChanged()
        End Sub

        #End Region

        #Region "Navigation Properties"
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <XmlIgnoreAttribute()>
        <SoapIgnoreAttribute()>
        <DataMemberAttribute()>
        <EdmRelationshipNavigationPropertyAttribute("NORTHWNDModel", "FK_Orders_Customers", "Customers")>
        Public Property Customer() As Customer
            Get
                Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Customer)("NORTHWNDModel.FK_Orders_Customers", "Customers").Value
            End Get
            Set
                CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Customer)("NORTHWNDModel.FK_Orders_Customers", "Customers").Value = value
            End Set
        End Property
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <BrowsableAttribute(False)>
        <DataMemberAttribute()>
        Public Property CustomerReference() As EntityReference(Of Customer)
            Get
                Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Customer)("NORTHWNDModel.FK_Orders_Customers", "Customers")
            End Get
            Set
                If (Not value Is Nothing)
                    CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedReference(Of Customer)("NORTHWNDModel.FK_Orders_Customers", "Customers", value)
                End If
            End Set
        End Property
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <XmlIgnoreAttribute()>
        <SoapIgnoreAttribute()>
        <DataMemberAttribute()>
        <EdmRelationshipNavigationPropertyAttribute("NORTHWNDModel", "FK_Order_Details_Orders", "Order_Details")>
         Public Property Order_Details() As EntityCollection(Of Order_Detail)
            Get
                Return CType(Me,IEntityWithRelationships).RelationshipManager.GetRelatedCollection(Of Order_Detail)("NORTHWNDModel.FK_Order_Details_Orders", "Order_Details")
            End Get
            Set
                If (Not value Is Nothing)
                    CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedCollection(Of Order_Detail)("NORTHWNDModel.FK_Order_Details_Orders", "Order_Details", value)
                End If
            End Set
        End Property

        #End Region

    End Class
    
    ''' <summary>
    ''' No Metadata Documentation available.
    ''' </summary>
    <EdmEntityTypeAttribute(NamespaceName:="NORTHWNDModel", Name:="Order_Detail")>
    <Serializable()>
    <DataContractAttribute(IsReference:=True)>
    Public Partial Class Order_Detail
        Inherits EntityObject
        #Region "Factory Method"
    
        ''' <summary>
        ''' Create a new Order_Detail object.
        ''' </summary>
        ''' <param name="orderID">Initial value of the OrderID property.</param>
        ''' <param name="productID">Initial value of the ProductID property.</param>
        ''' <param name="unitPrice">Initial value of the UnitPrice property.</param>
        ''' <param name="quantity">Initial value of the Quantity property.</param>
        ''' <param name="discount">Initial value of the Discount property.</param>
        Public Shared Function CreateOrder_Detail(orderID As Global.System.Int32, productID As Global.System.Int32, unitPrice As Global.System.Decimal, quantity As Global.System.Int16, discount As Global.System.Single) As Order_Detail
            Dim order_Detail as Order_Detail = New Order_Detail
            order_Detail.OrderID = orderID
            order_Detail.ProductID = productID
            order_Detail.UnitPrice = unitPrice
            order_Detail.Quantity = quantity
            order_Detail.Discount = discount
            Return order_Detail
        End Function

        #End Region

        #Region "Primitive Properties"
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property OrderID() As Global.System.Int32
            Get
                Return _OrderID
            End Get
            Set
                If (_OrderID <> Value) Then
                    OnOrderIDChanging(value)
                    ReportPropertyChanging("OrderID")
                    _OrderID = StructuralObject.SetValidValue(value)
                    ReportPropertyChanged("OrderID")
                    OnOrderIDChanged()
                End If
            End Set
        End Property
    
        Private _OrderID As Global.System.Int32
        Private Partial Sub OnOrderIDChanging(value As Global.System.Int32)
        End Sub
    
        Private Partial Sub OnOrderIDChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property ProductID() As Global.System.Int32
            Get
                Return _ProductID
            End Get
            Set
                If (_ProductID <> Value) Then
                    OnProductIDChanging(value)
                    ReportPropertyChanging("ProductID")
                    _ProductID = StructuralObject.SetValidValue(value)
                    ReportPropertyChanged("ProductID")
                    OnProductIDChanged()
                End If
            End Set
        End Property
    
        Private _ProductID As Global.System.Int32
        Private Partial Sub OnProductIDChanging(value As Global.System.Int32)
        End Sub
    
        Private Partial Sub OnProductIDChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property UnitPrice() As Global.System.Decimal
            Get
                Return _UnitPrice
            End Get
            Set
                OnUnitPriceChanging(value)
                ReportPropertyChanging("UnitPrice")
                _UnitPrice = StructuralObject.SetValidValue(value)
                ReportPropertyChanged("UnitPrice")
                OnUnitPriceChanged()
            End Set
        End Property
    
        Private _UnitPrice As Global.System.Decimal
        Private Partial Sub OnUnitPriceChanging(value As Global.System.Decimal)
        End Sub
    
        Private Partial Sub OnUnitPriceChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Quantity() As Global.System.Int16
            Get
                Return _Quantity
            End Get
            Set
                OnQuantityChanging(value)
                ReportPropertyChanging("Quantity")
                _Quantity = StructuralObject.SetValidValue(value)
                ReportPropertyChanged("Quantity")
                OnQuantityChanged()
            End Set
        End Property
    
        Private _Quantity As Global.System.Int16
        Private Partial Sub OnQuantityChanging(value As Global.System.Int16)
        End Sub
    
        Private Partial Sub OnQuantityChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Discount() As Global.System.Single
            Get
                Return _Discount
            End Get
            Set
                OnDiscountChanging(value)
                ReportPropertyChanging("Discount")
                _Discount = StructuralObject.SetValidValue(value)
                ReportPropertyChanged("Discount")
                OnDiscountChanged()
            End Set
        End Property
    
        Private _Discount As Global.System.Single
        Private Partial Sub OnDiscountChanging(value As Global.System.Single)
        End Sub
    
        Private Partial Sub OnDiscountChanged()
        End Sub

        #End Region

        #Region "Navigation Properties"
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <XmlIgnoreAttribute()>
        <SoapIgnoreAttribute()>
        <DataMemberAttribute()>
        <EdmRelationshipNavigationPropertyAttribute("NORTHWNDModel", "FK_Order_Details_Orders", "Orders")>
        Public Property Order() As Order
            Get
                Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Order)("NORTHWNDModel.FK_Order_Details_Orders", "Orders").Value
            End Get
            Set
                CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Order)("NORTHWNDModel.FK_Order_Details_Orders", "Orders").Value = value
            End Set
        End Property
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <BrowsableAttribute(False)>
        <DataMemberAttribute()>
        Public Property OrderReference() As EntityReference(Of Order)
            Get
                Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Order)("NORTHWNDModel.FK_Order_Details_Orders", "Orders")
            End Get
            Set
                If (Not value Is Nothing)
                    CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedReference(Of Order)("NORTHWNDModel.FK_Order_Details_Orders", "Orders", value)
                End If
            End Set
        End Property

        #End Region

    End Class

    #End Region

    
End Namespace
