Skip to main content

LightSwitch HTML Client Tutorial - Contoso Moving

This tutorial walks through building out the mobile client used by Contoso Movers’ planning specialists. This sample was created for Visual Studio 2012, but it will also upgrade and run in Visual Studio 2013.

VB.NET (6.3 MB)
 
 
 
 
 
4.5 Star
(13)
16,367 times
Add to favorites
12/6/2013
E-mail Twitter del.icio.us Digg Facebook

Solution explorer

VB.NET

'------------------------------------------------------------------------------
' <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("a92eaabc-e880-4910-919d-832c9d66acb0")>
#Region "EDM Relationship Metadata"
<Assembly: EdmRelationshipAttribute("LightSwitchApplication", "Appointment_State", "State", System.Data.Metadata.Edm.RelationshipMultiplicity.One, GetType(ApplicationData.Implementation.State), "Appointment", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, GetType(ApplicationData.Implementation.Appointment), True)>
<Assembly: EdmRelationshipAttribute("LightSwitchApplication", "Appointment_Customer", "Customer", System.Data.Metadata.Edm.RelationshipMultiplicity.One, GetType(ApplicationData.Implementation.Customer), "Appointment", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, GetType(ApplicationData.Implementation.Appointment), True)>
<Assembly: EdmRelationshipAttribute("LightSwitchApplication", "Photo_Appointment", "Appointment", System.Data.Metadata.Edm.RelationshipMultiplicity.One, GetType(ApplicationData.Implementation.Appointment), "Photo", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, GetType(ApplicationData.Implementation.Photo), True)>
<Assembly: EdmRelationshipAttribute("LightSwitchApplication", "InventoryItem_Room", "Room", System.Data.Metadata.Edm.RelationshipMultiplicity.One, GetType(ApplicationData.Implementation.Room), "InventoryItem", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, GetType(ApplicationData.Implementation.InventoryItem), True)>
<Assembly: EdmRelationshipAttribute("LightSwitchApplication", "Appointment_Employee", "Employee", System.Data.Metadata.Edm.RelationshipMultiplicity.One, GetType(ApplicationData.Implementation.Employee), "Appointment", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, GetType(ApplicationData.Implementation.Appointment), True)>
<Assembly: EdmRelationshipAttribute("LightSwitchApplication", "Appointment_Room", "Appointment", System.Data.Metadata.Edm.RelationshipMultiplicity.One, GetType(ApplicationData.Implementation.Appointment), "Room", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, GetType(ApplicationData.Implementation.Room), True)>
<Assembly: EdmRelationshipAttribute("LightSwitchApplication", "Customer_State", "State", System.Data.Metadata.Edm.RelationshipMultiplicity.One, GetType(ApplicationData.Implementation.State), "Customer", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, GetType(ApplicationData.Implementation.Customer), True)>

#End Region

Namespace ApplicationData.Implementation

    #Region "Contexts"
    
    ''' <summary>
    ''' No Metadata Documentation available.
    ''' </summary>
    Public Partial Class ApplicationDataObjectContext
        Inherits ObjectContext
    
        #Region "Constructors"
    
        ''' <summary>
        ''' Initializes a new ApplicationDataObjectContext object using the connection string found in the 'ApplicationDataObjectContext' section of the application configuration file.
        ''' </summary>
        Public Sub New()
            MyBase.New("name=ApplicationDataObjectContext", "ApplicationDataObjectContext")
            OnContextCreated()
        End Sub
    
        ''' <summary>
        ''' Initialize a new ApplicationDataObjectContext object.
        ''' </summary>
        Public Sub New(ByVal connectionString As String)
            MyBase.New(connectionString, "ApplicationDataObjectContext")
            OnContextCreated()
        End Sub
    
        ''' <summary>
        ''' Initialize a new ApplicationDataObjectContext object.
        ''' </summary>
        Public Sub New(ByVal connection As EntityConnection)
            MyBase.New(connection, "ApplicationDataObjectContext")
            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 States() As ObjectSet(Of State)
            Get
                If (_States Is Nothing) Then
                    _States = MyBase.CreateObjectSet(Of State)("States")
                End If
                Return _States
            End Get
        End Property
    
        Private _States As ObjectSet(Of State)
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        Public ReadOnly Property Appointments() As ObjectSet(Of Appointment)
            Get
                If (_Appointments Is Nothing) Then
                    _Appointments = MyBase.CreateObjectSet(Of Appointment)("Appointments")
                End If
                Return _Appointments
            End Get
        End Property
    
        Private _Appointments As ObjectSet(Of Appointment)
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        Public ReadOnly Property Employees() As ObjectSet(Of Employee)
            Get
                If (_Employees Is Nothing) Then
                    _Employees = MyBase.CreateObjectSet(Of Employee)("Employees")
                End If
                Return _Employees
            End Get
        End Property
    
        Private _Employees As ObjectSet(Of Employee)
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        Public ReadOnly Property Photos() As ObjectSet(Of Photo)
            Get
                If (_Photos Is Nothing) Then
                    _Photos = MyBase.CreateObjectSet(Of Photo)("Photos")
                End If
                Return _Photos
            End Get
        End Property
    
        Private _Photos As ObjectSet(Of Photo)
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        Public ReadOnly Property Rooms() As ObjectSet(Of Room)
            Get
                If (_Rooms Is Nothing) Then
                    _Rooms = MyBase.CreateObjectSet(Of Room)("Rooms")
                End If
                Return _Rooms
            End Get
        End Property
    
        Private _Rooms As ObjectSet(Of Room)
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        Public ReadOnly Property InventoryItems() As ObjectSet(Of InventoryItem)
            Get
                If (_InventoryItems Is Nothing) Then
                    _InventoryItems = MyBase.CreateObjectSet(Of InventoryItem)("InventoryItems")
                End If
                Return _InventoryItems
            End Get
        End Property
    
        Private _InventoryItems As ObjectSet(Of InventoryItem)

        #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 States EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
        ''' </summary>
        Public Sub AddToStates(ByVal state As State)
            MyBase.AddObject("States", state)
        End Sub
    
        ''' <summary>
        ''' Deprecated Method for adding a new object to the Appointments EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
        ''' </summary>
        Public Sub AddToAppointments(ByVal appointment As Appointment)
            MyBase.AddObject("Appointments", appointment)
        End Sub
    
        ''' <summary>
        ''' Deprecated Method for adding a new object to the Employees EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
        ''' </summary>
        Public Sub AddToEmployees(ByVal employee As Employee)
            MyBase.AddObject("Employees", employee)
        End Sub
    
        ''' <summary>
        ''' Deprecated Method for adding a new object to the Photos EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
        ''' </summary>
        Public Sub AddToPhotos(ByVal photo As Photo)
            MyBase.AddObject("Photos", photo)
        End Sub
    
        ''' <summary>
        ''' Deprecated Method for adding a new object to the Rooms EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
        ''' </summary>
        Public Sub AddToRooms(ByVal room As Room)
            MyBase.AddObject("Rooms", room)
        End Sub
    
        ''' <summary>
        ''' Deprecated Method for adding a new object to the InventoryItems EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
        ''' </summary>
        Public Sub AddToInventoryItems(ByVal inventoryItem As InventoryItem)
            MyBase.AddObject("InventoryItems", inventoryItem)
        End Sub

        #End Region

    End Class

    #End Region

    #Region "Entities"
    
    ''' <summary>
    ''' No Metadata Documentation available.
    ''' </summary>
    <EdmEntityTypeAttribute(NamespaceName:="LightSwitchApplication", Name:="Appointment")>
    <Serializable()>
    <DataContractAttribute(IsReference:=True)>
    Public Partial Class Appointment
        Inherits EntityObject
        #Region "Factory Method"
    
        ''' <summary>
        ''' Create a new Appointment object.
        ''' </summary>
        ''' <param name="id">Initial value of the Id property.</param>
        ''' <param name="rowVersion">Initial value of the RowVersion property.</param>
        ''' <param name="startDate">Initial value of the StartDate property.</param>
        ''' <param name="endDate">Initial value of the EndDate property.</param>
        ''' <param name="street">Initial value of the Street property.</param>
        ''' <param name="city">Initial value of the City property.</param>
        ''' <param name="postalCode">Initial value of the PostalCode property.</param>
        ''' <param name="moveType">Initial value of the MoveType property.</param>
        ''' <param name="appointment_State">Initial value of the Appointment_State property.</param>
        ''' <param name="appointment_Customer">Initial value of the Appointment_Customer property.</param>
        ''' <param name="appointment_Employee">Initial value of the Appointment_Employee property.</param>
        Public Shared Function CreateAppointment(id As Global.System.Int32, rowVersion As Global.System.Byte(), startDate As Global.System.DateTime, endDate As Global.System.DateTime, street As Global.System.String, city As Global.System.String, postalCode As Global.System.String, moveType As Global.System.String, appointment_State As Global.System.Int32, appointment_Customer As Global.System.Int32, appointment_Employee As Global.System.Int32) As Appointment
            Dim appointment as Appointment = New Appointment
            appointment.Id = id
            appointment.RowVersion = rowVersion
            appointment.StartDate = startDate
            appointment.EndDate = endDate
            appointment.Street = street
            appointment.City = city
            appointment.PostalCode = postalCode
            appointment.MoveType = moveType
            appointment.Appointment_State = appointment_State
            appointment.Appointment_Customer = appointment_Customer
            appointment.Appointment_Employee = appointment_Employee
            Return appointment
        End Function

        #End Region

        #Region "Primitive Properties"
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Id() As Global.System.Int32
            Get
                Return _Id
            End Get
            Set
                If (_Id <> Value) Then
                    OnIdChanging(value)
                    ReportPropertyChanging("Id")
                    _Id = value
                    ReportPropertyChanged("Id")
                    OnIdChanged()
                End If
            End Set
        End Property
    
        Private _Id As Global.System.Int32
        Private Partial Sub OnIdChanging(value As Global.System.Int32)
        End Sub
    
        Private Partial Sub OnIdChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property RowVersion() As Global.System.Byte()
            Get
                    Return StructuralObject.GetValidValue(_RowVersion)
            End Get
            Set
                OnRowVersionChanging(value)
                ReportPropertyChanging("RowVersion")
                _RowVersion = value
                ReportPropertyChanged("RowVersion")
                OnRowVersionChanged()
            End Set
        End Property
    
        Private _RowVersion As Global.System.Byte()
        Private Partial Sub OnRowVersionChanging(value As Global.System.Byte())
        End Sub
    
        Private Partial Sub OnRowVersionChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property StartDate() As Global.System.DateTime
            Get
                Return _StartDate
            End Get
            Set
                OnStartDateChanging(value)
                ReportPropertyChanging("StartDate")
                _StartDate = value
                ReportPropertyChanged("StartDate")
                OnStartDateChanged()
            End Set
        End Property
    
        Private _StartDate As Global.System.DateTime
        Private Partial Sub OnStartDateChanging(value As Global.System.DateTime)
        End Sub
    
        Private Partial Sub OnStartDateChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property EndDate() As Global.System.DateTime
            Get
                Return _EndDate
            End Get
            Set
                OnEndDateChanging(value)
                ReportPropertyChanging("EndDate")
                _EndDate = value
                ReportPropertyChanged("EndDate")
                OnEndDateChanged()
            End Set
        End Property
    
        Private _EndDate As Global.System.DateTime
        Private Partial Sub OnEndDateChanging(value As Global.System.DateTime)
        End Sub
    
        Private Partial Sub OnEndDateChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Street() As Global.System.String
            Get
                Return _Street
            End Get
            Set
                OnStreetChanging(value)
                ReportPropertyChanging("Street")
                _Street = value
                ReportPropertyChanged("Street")
                OnStreetChanged()
            End Set
        End Property
    
        Private _Street As Global.System.String
        Private Partial Sub OnStreetChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnStreetChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property StreetLine2() As Global.System.String
            Get
                Return _StreetLine2
            End Get
            Set
                OnStreetLine2Changing(value)
                ReportPropertyChanging("StreetLine2")
                _StreetLine2 = value
                ReportPropertyChanged("StreetLine2")
                OnStreetLine2Changed()
            End Set
        End Property
    
        Private _StreetLine2 As Global.System.String
        Private Partial Sub OnStreetLine2Changing(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnStreetLine2Changed()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property City() As Global.System.String
            Get
                Return _City
            End Get
            Set
                OnCityChanging(value)
                ReportPropertyChanging("City")
                _City = value
                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:=false)>
        <DataMemberAttribute()>
        Public Property PostalCode() As Global.System.String
            Get
                Return _PostalCode
            End Get
            Set
                OnPostalCodeChanging(value)
                ReportPropertyChanging("PostalCode")
                _PostalCode = value
                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 Notes() As Global.System.String
            Get
                Return _Notes
            End Get
            Set
                OnNotesChanging(value)
                ReportPropertyChanging("Notes")
                _Notes = value
                ReportPropertyChanged("Notes")
                OnNotesChanged()
            End Set
        End Property
    
        Private _Notes As Global.System.String
        Private Partial Sub OnNotesChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnNotesChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property MoveType() As Global.System.String
            Get
                Return _MoveType
            End Get
            Set
                OnMoveTypeChanging(value)
                ReportPropertyChanging("MoveType")
                _MoveType = value
                ReportPropertyChanged("MoveType")
                OnMoveTypeChanged()
            End Set
        End Property
    
        Private _MoveType As Global.System.String
        Private Partial Sub OnMoveTypeChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnMoveTypeChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Appointment_State() As Global.System.Int32
            Get
                Return _Appointment_State
            End Get
            Set
                OnAppointment_StateChanging(value)
                ReportPropertyChanging("Appointment_State")
                _Appointment_State = value
                ReportPropertyChanged("Appointment_State")
                OnAppointment_StateChanged()
            End Set
        End Property
    
        Private _Appointment_State As Global.System.Int32
        Private Partial Sub OnAppointment_StateChanging(value As Global.System.Int32)
        End Sub
    
        Private Partial Sub OnAppointment_StateChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Appointment_Customer() As Global.System.Int32
            Get
                Return _Appointment_Customer
            End Get
            Set
                OnAppointment_CustomerChanging(value)
                ReportPropertyChanging("Appointment_Customer")
                _Appointment_Customer = value
                ReportPropertyChanged("Appointment_Customer")
                OnAppointment_CustomerChanged()
            End Set
        End Property
    
        Private _Appointment_Customer As Global.System.Int32
        Private Partial Sub OnAppointment_CustomerChanging(value As Global.System.Int32)
        End Sub
    
        Private Partial Sub OnAppointment_CustomerChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Appointment_Employee() As Global.System.Int32
            Get
                Return _Appointment_Employee
            End Get
            Set
                OnAppointment_EmployeeChanging(value)
                ReportPropertyChanging("Appointment_Employee")
                _Appointment_Employee = value
                ReportPropertyChanged("Appointment_Employee")
                OnAppointment_EmployeeChanged()
            End Set
        End Property
    
        Private _Appointment_Employee As Global.System.Int32
        Private Partial Sub OnAppointment_EmployeeChanging(value As Global.System.Int32)
        End Sub
    
        Private Partial Sub OnAppointment_EmployeeChanged()
        End Sub

        #End Region

        #Region "Navigation Properties"
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <XmlIgnoreAttribute()>
        <SoapIgnoreAttribute()>
        <DataMemberAttribute()>
        <EdmRelationshipNavigationPropertyAttribute("LightSwitchApplication", "Appointment_State", "State")>
        Public Property State() As State
            Get
                Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of State)("LightSwitchApplication.Appointment_State", "State").Value
            End Get
            Set
                CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of State)("LightSwitchApplication.Appointment_State", "State").Value = value
            End Set
        End Property
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <BrowsableAttribute(False)>
        <DataMemberAttribute()>
        Public Property StateReference() As EntityReference(Of State)
            Get
                Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of State)("LightSwitchApplication.Appointment_State", "State")
            End Get
            Set
                If (Not value Is Nothing)
                    CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedReference(Of State)("LightSwitchApplication.Appointment_State", "State", value)
                End If
            End Set
        End Property
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <XmlIgnoreAttribute()>
        <SoapIgnoreAttribute()>
        <DataMemberAttribute()>
        <EdmRelationshipNavigationPropertyAttribute("LightSwitchApplication", "Photo_Appointment", "Photo")>
         Public Property Photos() As EntityCollection(Of Photo)
            Get
                Return CType(Me,IEntityWithRelationships).RelationshipManager.GetRelatedCollection(Of Photo)("LightSwitchApplication.Photo_Appointment", "Photo")
            End Get
            Set
                If (Not value Is Nothing)
                    CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedCollection(Of Photo)("LightSwitchApplication.Photo_Appointment", "Photo", value)
                End If
            End Set
        End Property
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <XmlIgnoreAttribute()>
        <SoapIgnoreAttribute()>
        <DataMemberAttribute()>
        <EdmRelationshipNavigationPropertyAttribute("LightSwitchApplication", "Appointment_Employee", "Employee")>
        Public Property Employee() As Employee
            Get
                Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Employee)("LightSwitchApplication.Appointment_Employee", "Employee").Value
            End Get
            Set
                CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Employee)("LightSwitchApplication.Appointment_Employee", "Employee").Value = value
            End Set
        End Property
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <BrowsableAttribute(False)>
        <DataMemberAttribute()>
        Public Property EmployeeReference() As EntityReference(Of Employee)
            Get
                Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Employee)("LightSwitchApplication.Appointment_Employee", "Employee")
            End Get
            Set
                If (Not value Is Nothing)
                    CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedReference(Of Employee)("LightSwitchApplication.Appointment_Employee", "Employee", value)
                End If
            End Set
        End Property
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <XmlIgnoreAttribute()>
        <SoapIgnoreAttribute()>
        <DataMemberAttribute()>
        <EdmRelationshipNavigationPropertyAttribute("LightSwitchApplication", "Appointment_Room", "Room")>
         Public Property Rooms() As EntityCollection(Of Room)
            Get
                Return CType(Me,IEntityWithRelationships).RelationshipManager.GetRelatedCollection(Of Room)("LightSwitchApplication.Appointment_Room", "Room")
            End Get
            Set
                If (Not value Is Nothing)
                    CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedCollection(Of Room)("LightSwitchApplication.Appointment_Room", "Room", value)
                End If
            End Set
        End Property
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <XmlIgnoreAttribute()>
        <SoapIgnoreAttribute()>
        <DataMemberAttribute()>
        <EdmRelationshipNavigationPropertyAttribute("LightSwitchApplication", "Appointment_Customer", "Customer")>
        Public Property Customer() As Customer
            Get
                Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Customer)("LightSwitchApplication.Appointment_Customer", "Customer").Value
            End Get
            Set
                CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Customer)("LightSwitchApplication.Appointment_Customer", "Customer").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)("LightSwitchApplication.Appointment_Customer", "Customer")
            End Get
            Set
                If (Not value Is Nothing)
                    CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedReference(Of Customer)("LightSwitchApplication.Appointment_Customer", "Customer", value)
                End If
            End Set
        End Property

        #End Region

    End Class
    
    ''' <summary>
    ''' No Metadata Documentation available.
    ''' </summary>
    <EdmEntityTypeAttribute(NamespaceName:="LightSwitchApplication", Name:="Customer")>
    <Serializable()>
    <DataContractAttribute(IsReference:=True)>
    Public Partial Class Customer
        Inherits EntityObject
        #Region "Factory Method"
    
        ''' <summary>
        ''' Create a new Customer object.
        ''' </summary>
        ''' <param name="id">Initial value of the Id property.</param>
        ''' <param name="rowVersion">Initial value of the RowVersion property.</param>
        ''' <param name="lastName">Initial value of the LastName property.</param>
        ''' <param name="firstName">Initial value of the FirstName property.</param>
        ''' <param name="phone">Initial value of the Phone property.</param>
        ''' <param name="street">Initial value of the Street property.</param>
        ''' <param name="city">Initial value of the City property.</param>
        ''' <param name="postalCode">Initial value of the PostalCode property.</param>
        ''' <param name="customer_State">Initial value of the Customer_State property.</param>
        Public Shared Function CreateCustomer(id As Global.System.Int32, rowVersion As Global.System.Byte(), lastName As Global.System.String, firstName As Global.System.String, phone As Global.System.String, street As Global.System.String, city As Global.System.String, postalCode As Global.System.String, customer_State As Global.System.Int32) As Customer
            Dim customer as Customer = New Customer
            customer.Id = id
            customer.RowVersion = rowVersion
            customer.LastName = lastName
            customer.FirstName = firstName
            customer.Phone = phone
            customer.Street = street
            customer.City = city
            customer.PostalCode = postalCode
            customer.Customer_State = customer_State
            Return customer
        End Function

        #End Region

        #Region "Primitive Properties"
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Id() As Global.System.Int32
            Get
                Return _Id
            End Get
            Set
                If (_Id <> Value) Then
                    OnIdChanging(value)
                    ReportPropertyChanging("Id")
                    _Id = value
                    ReportPropertyChanged("Id")
                    OnIdChanged()
                End If
            End Set
        End Property
    
        Private _Id As Global.System.Int32
        Private Partial Sub OnIdChanging(value As Global.System.Int32)
        End Sub
    
        Private Partial Sub OnIdChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property RowVersion() As Global.System.Byte()
            Get
                    Return StructuralObject.GetValidValue(_RowVersion)
            End Get
            Set
                OnRowVersionChanging(value)
                ReportPropertyChanging("RowVersion")
                _RowVersion = value
                ReportPropertyChanged("RowVersion")
                OnRowVersionChanged()
            End Set
        End Property
    
        Private _RowVersion As Global.System.Byte()
        Private Partial Sub OnRowVersionChanging(value As Global.System.Byte())
        End Sub
    
        Private Partial Sub OnRowVersionChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property LastName() As Global.System.String
            Get
                Return _LastName
            End Get
            Set
                OnLastNameChanging(value)
                ReportPropertyChanging("LastName")
                _LastName = value
                ReportPropertyChanged("LastName")
                OnLastNameChanged()
            End Set
        End Property
    
        Private _LastName As Global.System.String
        Private Partial Sub OnLastNameChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnLastNameChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property FirstName() As Global.System.String
            Get
                Return _FirstName
            End Get
            Set
                OnFirstNameChanging(value)
                ReportPropertyChanging("FirstName")
                _FirstName = value
                ReportPropertyChanged("FirstName")
                OnFirstNameChanged()
            End Set
        End Property
    
        Private _FirstName As Global.System.String
        Private Partial Sub OnFirstNameChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnFirstNameChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Phone() As Global.System.String
            Get
                Return _Phone
            End Get
            Set
                OnPhoneChanging(value)
                ReportPropertyChanging("Phone")
                _Phone = value
                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 Email() As Global.System.String
            Get
                Return _Email
            End Get
            Set
                OnEmailChanging(value)
                ReportPropertyChanging("Email")
                _Email = value
                ReportPropertyChanged("Email")
                OnEmailChanged()
            End Set
        End Property
    
        Private _Email As Global.System.String
        Private Partial Sub OnEmailChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnEmailChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Street() As Global.System.String
            Get
                Return _Street
            End Get
            Set
                OnStreetChanging(value)
                ReportPropertyChanging("Street")
                _Street = value
                ReportPropertyChanged("Street")
                OnStreetChanged()
            End Set
        End Property
    
        Private _Street As Global.System.String
        Private Partial Sub OnStreetChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnStreetChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property StreetLine2() As Global.System.String
            Get
                Return _StreetLine2
            End Get
            Set
                OnStreetLine2Changing(value)
                ReportPropertyChanging("StreetLine2")
                _StreetLine2 = value
                ReportPropertyChanged("StreetLine2")
                OnStreetLine2Changed()
            End Set
        End Property
    
        Private _StreetLine2 As Global.System.String
        Private Partial Sub OnStreetLine2Changing(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnStreetLine2Changed()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property City() As Global.System.String
            Get
                Return _City
            End Get
            Set
                OnCityChanging(value)
                ReportPropertyChanging("City")
                _City = value
                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:=false)>
        <DataMemberAttribute()>
        Public Property PostalCode() As Global.System.String
            Get
                Return _PostalCode
            End Get
            Set
                OnPostalCodeChanging(value)
                ReportPropertyChanging("PostalCode")
                _PostalCode = value
                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:=false)>
        <DataMemberAttribute()>
        Public Property Customer_State() As Global.System.Int32
            Get
                Return _Customer_State
            End Get
            Set
                OnCustomer_StateChanging(value)
                ReportPropertyChanging("Customer_State")
                _Customer_State = value
                ReportPropertyChanged("Customer_State")
                OnCustomer_StateChanged()
            End Set
        End Property
    
        Private _Customer_State As Global.System.Int32
        Private Partial Sub OnCustomer_StateChanging(value As Global.System.Int32)
        End Sub
    
        Private Partial Sub OnCustomer_StateChanged()
        End Sub

        #End Region

        #Region "Navigation Properties"
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <XmlIgnoreAttribute()>
        <SoapIgnoreAttribute()>
        <DataMemberAttribute()>
        <EdmRelationshipNavigationPropertyAttribute("LightSwitchApplication", "Customer_State", "State")>
        Public Property State() As State
            Get
                Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of State)("LightSwitchApplication.Customer_State", "State").Value
            End Get
            Set
                CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of State)("LightSwitchApplication.Customer_State", "State").Value = value
            End Set
        End Property
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <BrowsableAttribute(False)>
        <DataMemberAttribute()>
        Public Property StateReference() As EntityReference(Of State)
            Get
                Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of State)("LightSwitchApplication.Customer_State", "State")
            End Get
            Set
                If (Not value Is Nothing)
                    CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedReference(Of State)("LightSwitchApplication.Customer_State", "State", value)
                End If
            End Set
        End Property
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <XmlIgnoreAttribute()>
        <SoapIgnoreAttribute()>
        <DataMemberAttribute()>
        <EdmRelationshipNavigationPropertyAttribute("LightSwitchApplication", "Appointment_Customer", "Appointment")>
         Public Property Appointments() As EntityCollection(Of Appointment)
            Get
                Return CType(Me,IEntityWithRelationships).RelationshipManager.GetRelatedCollection(Of Appointment)("LightSwitchApplication.Appointment_Customer", "Appointment")
            End Get
            Set
                If (Not value Is Nothing)
                    CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedCollection(Of Appointment)("LightSwitchApplication.Appointment_Customer", "Appointment", value)
                End If
            End Set
        End Property

        #End Region

    End Class
    
    ''' <summary>
    ''' No Metadata Documentation available.
    ''' </summary>
    <EdmEntityTypeAttribute(NamespaceName:="LightSwitchApplication", Name:="Employee")>
    <Serializable()>
    <DataContractAttribute(IsReference:=True)>
    Public Partial Class Employee
        Inherits EntityObject
        #Region "Factory Method"
    
        ''' <summary>
        ''' Create a new Employee object.
        ''' </summary>
        ''' <param name="id">Initial value of the Id property.</param>
        ''' <param name="rowVersion">Initial value of the RowVersion property.</param>
        ''' <param name="firstName">Initial value of the FirstName property.</param>
        ''' <param name="lastName">Initial value of the LastName property.</param>
        ''' <param name="userName">Initial value of the UserName property.</param>
        Public Shared Function CreateEmployee(id As Global.System.Int32, rowVersion As Global.System.Byte(), firstName As Global.System.String, lastName As Global.System.String, userName As Global.System.String) As Employee
            Dim employee as Employee = New Employee
            employee.Id = id
            employee.RowVersion = rowVersion
            employee.FirstName = firstName
            employee.LastName = lastName
            employee.UserName = userName
            Return employee
        End Function

        #End Region

        #Region "Primitive Properties"
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Id() As Global.System.Int32
            Get
                Return _Id
            End Get
            Set
                If (_Id <> Value) Then
                    OnIdChanging(value)
                    ReportPropertyChanging("Id")
                    _Id = value
                    ReportPropertyChanged("Id")
                    OnIdChanged()
                End If
            End Set
        End Property
    
        Private _Id As Global.System.Int32
        Private Partial Sub OnIdChanging(value As Global.System.Int32)
        End Sub
    
        Private Partial Sub OnIdChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property RowVersion() As Global.System.Byte()
            Get
                    Return StructuralObject.GetValidValue(_RowVersion)
            End Get
            Set
                OnRowVersionChanging(value)
                ReportPropertyChanging("RowVersion")
                _RowVersion = value
                ReportPropertyChanged("RowVersion")
                OnRowVersionChanged()
            End Set
        End Property
    
        Private _RowVersion As Global.System.Byte()
        Private Partial Sub OnRowVersionChanging(value As Global.System.Byte())
        End Sub
    
        Private Partial Sub OnRowVersionChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property FirstName() As Global.System.String
            Get
                Return _FirstName
            End Get
            Set
                OnFirstNameChanging(value)
                ReportPropertyChanging("FirstName")
                _FirstName = value
                ReportPropertyChanged("FirstName")
                OnFirstNameChanged()
            End Set
        End Property
    
        Private _FirstName As Global.System.String
        Private Partial Sub OnFirstNameChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnFirstNameChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property LastName() As Global.System.String
            Get
                Return _LastName
            End Get
            Set
                OnLastNameChanging(value)
                ReportPropertyChanging("LastName")
                _LastName = value
                ReportPropertyChanged("LastName")
                OnLastNameChanged()
            End Set
        End Property
    
        Private _LastName As Global.System.String
        Private Partial Sub OnLastNameChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnLastNameChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property UserName() As Global.System.String
            Get
                Return _UserName
            End Get
            Set
                OnUserNameChanging(value)
                ReportPropertyChanging("UserName")
                _UserName = value
                ReportPropertyChanged("UserName")
                OnUserNameChanged()
            End Set
        End Property
    
        Private _UserName As Global.System.String
        Private Partial Sub OnUserNameChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnUserNameChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property Email() As Global.System.String
            Get
                Return _Email
            End Get
            Set
                OnEmailChanging(value)
                ReportPropertyChanging("Email")
                _Email = value
                ReportPropertyChanged("Email")
                OnEmailChanged()
            End Set
        End Property
    
        Private _Email As Global.System.String
        Private Partial Sub OnEmailChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnEmailChanged()
        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 = value
                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

        #End Region

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

        #End Region

    End Class
    
    ''' <summary>
    ''' No Metadata Documentation available.
    ''' </summary>
    <EdmEntityTypeAttribute(NamespaceName:="LightSwitchApplication", Name:="InventoryItem")>
    <Serializable()>
    <DataContractAttribute(IsReference:=True)>
    Public Partial Class InventoryItem
        Inherits EntityObject
        #Region "Factory Method"
    
        ''' <summary>
        ''' Create a new InventoryItem object.
        ''' </summary>
        ''' <param name="id">Initial value of the Id property.</param>
        ''' <param name="rowVersion">Initial value of the RowVersion property.</param>
        ''' <param name="name">Initial value of the Name property.</param>
        ''' <param name="quantity">Initial value of the Quantity property.</param>
        ''' <param name="inventoryItem_Room">Initial value of the InventoryItem_Room property.</param>
        Public Shared Function CreateInventoryItem(id As Global.System.Int32, rowVersion As Global.System.Byte(), name As Global.System.String, quantity As Global.System.Int32, inventoryItem_Room As Global.System.Int32) As InventoryItem
            Dim inventoryItem as InventoryItem = New InventoryItem
            inventoryItem.Id = id
            inventoryItem.RowVersion = rowVersion
            inventoryItem.Name = name
            inventoryItem.Quantity = quantity
            inventoryItem.InventoryItem_Room = inventoryItem_Room
            Return inventoryItem
        End Function

        #End Region

        #Region "Primitive Properties"
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Id() As Global.System.Int32
            Get
                Return _Id
            End Get
            Set
                If (_Id <> Value) Then
                    OnIdChanging(value)
                    ReportPropertyChanging("Id")
                    _Id = value
                    ReportPropertyChanged("Id")
                    OnIdChanged()
                End If
            End Set
        End Property
    
        Private _Id As Global.System.Int32
        Private Partial Sub OnIdChanging(value As Global.System.Int32)
        End Sub
    
        Private Partial Sub OnIdChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property RowVersion() As Global.System.Byte()
            Get
                    Return StructuralObject.GetValidValue(_RowVersion)
            End Get
            Set
                OnRowVersionChanging(value)
                ReportPropertyChanging("RowVersion")
                _RowVersion = value
                ReportPropertyChanged("RowVersion")
                OnRowVersionChanged()
            End Set
        End Property
    
        Private _RowVersion As Global.System.Byte()
        Private Partial Sub OnRowVersionChanging(value As Global.System.Byte())
        End Sub
    
        Private Partial Sub OnRowVersionChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Name() As Global.System.String
            Get
                Return _Name
            End Get
            Set
                OnNameChanging(value)
                ReportPropertyChanging("Name")
                _Name = value
                ReportPropertyChanged("Name")
                OnNameChanged()
            End Set
        End Property
    
        Private _Name As Global.System.String
        Private Partial Sub OnNameChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnNameChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Quantity() As Global.System.Int32
            Get
                Return _Quantity
            End Get
            Set
                OnQuantityChanging(value)
                ReportPropertyChanging("Quantity")
                _Quantity = value
                ReportPropertyChanged("Quantity")
                OnQuantityChanged()
            End Set
        End Property
    
        Private _Quantity As Global.System.Int32
        Private Partial Sub OnQuantityChanging(value As Global.System.Int32)
        End Sub
    
        Private Partial Sub OnQuantityChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property InventoryItem_Room() As Global.System.Int32
            Get
                Return _InventoryItem_Room
            End Get
            Set
                OnInventoryItem_RoomChanging(value)
                ReportPropertyChanging("InventoryItem_Room")
                _InventoryItem_Room = value
                ReportPropertyChanged("InventoryItem_Room")
                OnInventoryItem_RoomChanged()
            End Set
        End Property
    
        Private _InventoryItem_Room As Global.System.Int32
        Private Partial Sub OnInventoryItem_RoomChanging(value As Global.System.Int32)
        End Sub
    
        Private Partial Sub OnInventoryItem_RoomChanged()
        End Sub

        #End Region

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

        #End Region

    End Class
    
    ''' <summary>
    ''' No Metadata Documentation available.
    ''' </summary>
    <EdmEntityTypeAttribute(NamespaceName:="LightSwitchApplication", Name:="Photo")>
    <Serializable()>
    <DataContractAttribute(IsReference:=True)>
    Public Partial Class Photo
        Inherits EntityObject
        #Region "Factory Method"
    
        ''' <summary>
        ''' Create a new Photo object.
        ''' </summary>
        ''' <param name="id">Initial value of the Id property.</param>
        ''' <param name="rowVersion">Initial value of the RowVersion property.</param>
        ''' <param name="appointmentPhoto_Appointment">Initial value of the AppointmentPhoto_Appointment property.</param>
        Public Shared Function CreatePhoto(id As Global.System.Int32, rowVersion As Global.System.Byte(), appointmentPhoto_Appointment As Global.System.Int32) As Photo
            Dim photo as Photo = New Photo
            photo.Id = id
            photo.RowVersion = rowVersion
            photo.AppointmentPhoto_Appointment = appointmentPhoto_Appointment
            Return photo
        End Function

        #End Region

        #Region "Primitive Properties"
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Id() As Global.System.Int32
            Get
                Return _Id
            End Get
            Set
                If (_Id <> Value) Then
                    OnIdChanging(value)
                    ReportPropertyChanging("Id")
                    _Id = value
                    ReportPropertyChanged("Id")
                    OnIdChanged()
                End If
            End Set
        End Property
    
        Private _Id As Global.System.Int32
        Private Partial Sub OnIdChanging(value As Global.System.Int32)
        End Sub
    
        Private Partial Sub OnIdChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property RowVersion() As Global.System.Byte()
            Get
                    Return StructuralObject.GetValidValue(_RowVersion)
            End Get
            Set
                OnRowVersionChanging(value)
                ReportPropertyChanging("RowVersion")
                _RowVersion = value
                ReportPropertyChanged("RowVersion")
                OnRowVersionChanged()
            End Set
        End Property
    
        Private _RowVersion As Global.System.Byte()
        Private Partial Sub OnRowVersionChanging(value As Global.System.Byte())
        End Sub
    
        Private Partial Sub OnRowVersionChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property Picture() As Global.System.Byte()
            Get
                    Return StructuralObject.GetValidValue(_Picture)
            End Get
            Set
                OnPictureChanging(value)
                ReportPropertyChanging("Picture")
                _Picture = value
                ReportPropertyChanged("Picture")
                OnPictureChanged()
            End Set
        End Property
    
        Private _Picture As Global.System.Byte()
        Private Partial Sub OnPictureChanging(value As Global.System.Byte())
        End Sub
    
        Private Partial Sub OnPictureChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property Caption() As Global.System.String
            Get
                Return _Caption
            End Get
            Set
                OnCaptionChanging(value)
                ReportPropertyChanging("Caption")
                _Caption = value
                ReportPropertyChanged("Caption")
                OnCaptionChanged()
            End Set
        End Property
    
        Private _Caption As Global.System.String
        Private Partial Sub OnCaptionChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnCaptionChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property AppointmentPhoto_Appointment() As Global.System.Int32
            Get
                Return _AppointmentPhoto_Appointment
            End Get
            Set
                OnAppointmentPhoto_AppointmentChanging(value)
                ReportPropertyChanging("AppointmentPhoto_Appointment")
                _AppointmentPhoto_Appointment = value
                ReportPropertyChanged("AppointmentPhoto_Appointment")
                OnAppointmentPhoto_AppointmentChanged()
            End Set
        End Property
    
        Private _AppointmentPhoto_Appointment As Global.System.Int32
        Private Partial Sub OnAppointmentPhoto_AppointmentChanging(value As Global.System.Int32)
        End Sub
    
        Private Partial Sub OnAppointmentPhoto_AppointmentChanged()
        End Sub

        #End Region

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

        #End Region

    End Class
    
    ''' <summary>
    ''' No Metadata Documentation available.
    ''' </summary>
    <EdmEntityTypeAttribute(NamespaceName:="LightSwitchApplication", Name:="Room")>
    <Serializable()>
    <DataContractAttribute(IsReference:=True)>
    Public Partial Class Room
        Inherits EntityObject
        #Region "Factory Method"
    
        ''' <summary>
        ''' Create a new Room object.
        ''' </summary>
        ''' <param name="id">Initial value of the Id property.</param>
        ''' <param name="rowVersion">Initial value of the RowVersion property.</param>
        ''' <param name="name">Initial value of the Name property.</param>
        ''' <param name="appointment_Room">Initial value of the Appointment_Room property.</param>
        Public Shared Function CreateRoom(id As Global.System.Int32, rowVersion As Global.System.Byte(), name As Global.System.String, appointment_Room As Global.System.Int32) As Room
            Dim room as Room = New Room
            room.Id = id
            room.RowVersion = rowVersion
            room.Name = name
            room.Appointment_Room = appointment_Room
            Return room
        End Function

        #End Region

        #Region "Primitive Properties"
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Id() As Global.System.Int32
            Get
                Return _Id
            End Get
            Set
                If (_Id <> Value) Then
                    OnIdChanging(value)
                    ReportPropertyChanging("Id")
                    _Id = value
                    ReportPropertyChanged("Id")
                    OnIdChanged()
                End If
            End Set
        End Property
    
        Private _Id As Global.System.Int32
        Private Partial Sub OnIdChanging(value As Global.System.Int32)
        End Sub
    
        Private Partial Sub OnIdChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property RowVersion() As Global.System.Byte()
            Get
                    Return StructuralObject.GetValidValue(_RowVersion)
            End Get
            Set
                OnRowVersionChanging(value)
                ReportPropertyChanging("RowVersion")
                _RowVersion = value
                ReportPropertyChanged("RowVersion")
                OnRowVersionChanged()
            End Set
        End Property
    
        Private _RowVersion As Global.System.Byte()
        Private Partial Sub OnRowVersionChanging(value As Global.System.Byte())
        End Sub
    
        Private Partial Sub OnRowVersionChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Name() As Global.System.String
            Get
                Return _Name
            End Get
            Set
                OnNameChanging(value)
                ReportPropertyChanging("Name")
                _Name = value
                ReportPropertyChanged("Name")
                OnNameChanged()
            End Set
        End Property
    
        Private _Name As Global.System.String
        Private Partial Sub OnNameChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnNameChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
        <DataMemberAttribute()>
        Public Property Notes() As Global.System.String
            Get
                Return _Notes
            End Get
            Set
                OnNotesChanging(value)
                ReportPropertyChanging("Notes")
                _Notes = value
                ReportPropertyChanged("Notes")
                OnNotesChanged()
            End Set
        End Property
    
        Private _Notes As Global.System.String
        Private Partial Sub OnNotesChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnNotesChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Appointment_Room() As Global.System.Int32
            Get
                Return _Appointment_Room
            End Get
            Set
                OnAppointment_RoomChanging(value)
                ReportPropertyChanging("Appointment_Room")
                _Appointment_Room = value
                ReportPropertyChanged("Appointment_Room")
                OnAppointment_RoomChanged()
            End Set
        End Property
    
        Private _Appointment_Room As Global.System.Int32
        Private Partial Sub OnAppointment_RoomChanging(value As Global.System.Int32)
        End Sub
    
        Private Partial Sub OnAppointment_RoomChanged()
        End Sub

        #End Region

        #Region "Navigation Properties"
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <XmlIgnoreAttribute()>
        <SoapIgnoreAttribute()>
        <DataMemberAttribute()>
        <EdmRelationshipNavigationPropertyAttribute("LightSwitchApplication", "InventoryItem_Room", "InventoryItem")>
         Public Property InventoryItems() As EntityCollection(Of InventoryItem)
            Get
                Return CType(Me,IEntityWithRelationships).RelationshipManager.GetRelatedCollection(Of InventoryItem)("LightSwitchApplication.InventoryItem_Room", "InventoryItem")
            End Get
            Set
                If (Not value Is Nothing)
                    CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedCollection(Of InventoryItem)("LightSwitchApplication.InventoryItem_Room", "InventoryItem", value)
                End If
            End Set
        End Property
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <XmlIgnoreAttribute()>
        <SoapIgnoreAttribute()>
        <DataMemberAttribute()>
        <EdmRelationshipNavigationPropertyAttribute("LightSwitchApplication", "Appointment_Room", "Appointment")>
        Public Property Appointment() As Appointment
            Get
                Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Appointment)("LightSwitchApplication.Appointment_Room", "Appointment").Value
            End Get
            Set
                CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Appointment)("LightSwitchApplication.Appointment_Room", "Appointment").Value = value
            End Set
        End Property
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <BrowsableAttribute(False)>
        <DataMemberAttribute()>
        Public Property AppointmentReference() As EntityReference(Of Appointment)
            Get
                Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Appointment)("LightSwitchApplication.Appointment_Room", "Appointment")
            End Get
            Set
                If (Not value Is Nothing)
                    CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedReference(Of Appointment)("LightSwitchApplication.Appointment_Room", "Appointment", value)
                End If
            End Set
        End Property

        #End Region

    End Class
    
    ''' <summary>
    ''' No Metadata Documentation available.
    ''' </summary>
    <EdmEntityTypeAttribute(NamespaceName:="LightSwitchApplication", Name:="State")>
    <Serializable()>
    <DataContractAttribute(IsReference:=True)>
    Public Partial Class State
        Inherits EntityObject
        #Region "Factory Method"
    
        ''' <summary>
        ''' Create a new State object.
        ''' </summary>
        ''' <param name="id">Initial value of the Id property.</param>
        ''' <param name="rowVersion">Initial value of the RowVersion property.</param>
        ''' <param name="name">Initial value of the Name property.</param>
        ''' <param name="abbreviation">Initial value of the Abbreviation property.</param>
        Public Shared Function CreateState(id As Global.System.Int32, rowVersion As Global.System.Byte(), name As Global.System.String, abbreviation As Global.System.String) As State
            Dim state as State = New State
            state.Id = id
            state.RowVersion = rowVersion
            state.Name = name
            state.Abbreviation = abbreviation
            Return state
        End Function

        #End Region

        #Region "Primitive Properties"
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Id() As Global.System.Int32
            Get
                Return _Id
            End Get
            Set
                If (_Id <> Value) Then
                    OnIdChanging(value)
                    ReportPropertyChanging("Id")
                    _Id = value
                    ReportPropertyChanged("Id")
                    OnIdChanged()
                End If
            End Set
        End Property
    
        Private _Id As Global.System.Int32
        Private Partial Sub OnIdChanging(value As Global.System.Int32)
        End Sub
    
        Private Partial Sub OnIdChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property RowVersion() As Global.System.Byte()
            Get
                    Return StructuralObject.GetValidValue(_RowVersion)
            End Get
            Set
                OnRowVersionChanging(value)
                ReportPropertyChanging("RowVersion")
                _RowVersion = value
                ReportPropertyChanged("RowVersion")
                OnRowVersionChanged()
            End Set
        End Property
    
        Private _RowVersion As Global.System.Byte()
        Private Partial Sub OnRowVersionChanging(value As Global.System.Byte())
        End Sub
    
        Private Partial Sub OnRowVersionChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Name() As Global.System.String
            Get
                Return _Name
            End Get
            Set
                OnNameChanging(value)
                ReportPropertyChanging("Name")
                _Name = value
                ReportPropertyChanged("Name")
                OnNameChanged()
            End Set
        End Property
    
        Private _Name As Global.System.String
        Private Partial Sub OnNameChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnNameChanged()
        End Sub
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=false)>
        <DataMemberAttribute()>
        Public Property Abbreviation() As Global.System.String
            Get
                Return _Abbreviation
            End Get
            Set
                OnAbbreviationChanging(value)
                ReportPropertyChanging("Abbreviation")
                _Abbreviation = value
                ReportPropertyChanged("Abbreviation")
                OnAbbreviationChanged()
            End Set
        End Property
    
        Private _Abbreviation As Global.System.String
        Private Partial Sub OnAbbreviationChanging(value As Global.System.String)
        End Sub
    
        Private Partial Sub OnAbbreviationChanged()
        End Sub

        #End Region

        #Region "Navigation Properties"
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <XmlIgnoreAttribute()>
        <SoapIgnoreAttribute()>
        <DataMemberAttribute()>
        <EdmRelationshipNavigationPropertyAttribute("LightSwitchApplication", "Customer_State", "Customer")>
         Public Property Customers() As EntityCollection(Of Customer)
            Get
                Return CType(Me,IEntityWithRelationships).RelationshipManager.GetRelatedCollection(Of Customer)("LightSwitchApplication.Customer_State", "Customer")
            End Get
            Set
                If (Not value Is Nothing)
                    CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedCollection(Of Customer)("LightSwitchApplication.Customer_State", "Customer", value)
                End If
            End Set
        End Property
    
        ''' <summary>
        ''' No Metadata Documentation available.
        ''' </summary>
        <XmlIgnoreAttribute()>
        <SoapIgnoreAttribute()>
        <DataMemberAttribute()>
        <EdmRelationshipNavigationPropertyAttribute("LightSwitchApplication", "Appointment_State", "Appointment")>
         Public Property Appointments() As EntityCollection(Of Appointment)
            Get
                Return CType(Me,IEntityWithRelationships).RelationshipManager.GetRelatedCollection(Of Appointment)("LightSwitchApplication.Appointment_State", "Appointment")
            End Get
            Set
                If (Not value Is Nothing)
                    CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedCollection(Of Appointment)("LightSwitchApplication.Appointment_State", "Appointment", value)
                End If
            End Set
        End Property

        #End Region

    End Class

    #End Region

    
End Namespace