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,366 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 by a tool.
'     Runtime Version:4.0.30319.18010
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict Off
Option Explicit On


'Original file name:
'Generation date: 11/8/2012 2:52:09 PM
Namespace LightSwitchApplication.Implementation
    '''<summary>
    '''There are no comments for ApplicationDataObjectContext in the schema.
    '''</summary>
    Partial Public Class ApplicationDataObjectContext
        Inherits Global.Microsoft.LightSwitch.ClientGenerated.Implementation.DataServiceContext
        '''<summary>
        '''Initialize a new ApplicationDataObjectContext object.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Sub New(ByVal serviceRoot As Global.System.Uri)
            MyBase.New(serviceRoot)
            Me.ResolveName = AddressOf Me.ResolveNameFromType
            Me.ResolveType = AddressOf Me.ResolveTypeFromName
            Me.OnContextCreated
        End Sub
        Partial Private Sub OnContextCreated()
        End Sub
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private Shared ROOTNAMESPACE As String = GetType(LightSwitchApplication.Implementation.ApplicationDataObjectContext).Namespace.Remove(GetType(LightSwitchApplication.Implementation.ApplicationDataObjectContext).Namespace.LastIndexOf("LightSwitchApplication.Implementation"))
        '''<summary>
        '''Since the namespace configured for this service reference
        '''in Visual Studio is different from the one indicated in the
        '''server schema, use type-mappers to map between the two.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Protected Function ResolveTypeFromName(ByVal typeName As String) As Global.System.Type
            If typeName.StartsWith("LightSwitchApplication", Global.System.StringComparison.OrdinalIgnoreCase) Then
                Return Me.GetType.Assembly.GetType(String.Concat(String.Concat(ROOTNAMESPACE, "LightSwitchApplication.Implementation"), typeName.Substring(22)), false)
            End If
            Return Nothing
        End Function
        '''<summary>
        '''Since the namespace configured for this service reference
        '''in Visual Studio is different from the one indicated in the
        '''server schema, use type-mappers to map between the two.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Protected Function ResolveNameFromType(ByVal clientType As Global.System.Type) As String
            If clientType.Namespace.Equals(String.Concat(ROOTNAMESPACE, "LightSwitchApplication.Implementation"), Global.System.StringComparison.OrdinalIgnoreCase) Then
                Return String.Concat("LightSwitchApplication.", clientType.Name)
            End If
            Return Nothing
        End Function
        '''<summary>
        '''There are no comments for Customers in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public ReadOnly Property Customers() As Global.System.Data.Services.Client.DataServiceQuery(Of Customer)
            Get
                If (Me._Customers Is Nothing) Then
                    Me._Customers = MyBase.CreateQuery(Of Customer)("Customers")
                End If
                Return Me._Customers
            End Get
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Customers As Global.System.Data.Services.Client.DataServiceQuery(Of Customer)
        '''<summary>
        '''There are no comments for States in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public ReadOnly Property States() As Global.System.Data.Services.Client.DataServiceQuery(Of State)
            Get
                If (Me._States Is Nothing) Then
                    Me._States = MyBase.CreateQuery(Of State)("States")
                End If
                Return Me._States
            End Get
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _States As Global.System.Data.Services.Client.DataServiceQuery(Of State)
        '''<summary>
        '''There are no comments for Appointments in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public ReadOnly Property Appointments() As Global.System.Data.Services.Client.DataServiceQuery(Of Appointment)
            Get
                If (Me._Appointments Is Nothing) Then
                    Me._Appointments = MyBase.CreateQuery(Of Appointment)("Appointments")
                End If
                Return Me._Appointments
            End Get
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Appointments As Global.System.Data.Services.Client.DataServiceQuery(Of Appointment)
        '''<summary>
        '''There are no comments for Employees in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public ReadOnly Property Employees() As Global.System.Data.Services.Client.DataServiceQuery(Of Employee)
            Get
                If (Me._Employees Is Nothing) Then
                    Me._Employees = MyBase.CreateQuery(Of Employee)("Employees")
                End If
                Return Me._Employees
            End Get
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Employees As Global.System.Data.Services.Client.DataServiceQuery(Of Employee)
        '''<summary>
        '''There are no comments for Photos in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public ReadOnly Property Photos() As Global.System.Data.Services.Client.DataServiceQuery(Of Photo)
            Get
                If (Me._Photos Is Nothing) Then
                    Me._Photos = MyBase.CreateQuery(Of Photo)("Photos")
                End If
                Return Me._Photos
            End Get
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Photos As Global.System.Data.Services.Client.DataServiceQuery(Of Photo)
        '''<summary>
        '''There are no comments for Rooms in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public ReadOnly Property Rooms() As Global.System.Data.Services.Client.DataServiceQuery(Of Room)
            Get
                If (Me._Rooms Is Nothing) Then
                    Me._Rooms = MyBase.CreateQuery(Of Room)("Rooms")
                End If
                Return Me._Rooms
            End Get
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Rooms As Global.System.Data.Services.Client.DataServiceQuery(Of Room)
        '''<summary>
        '''There are no comments for InventoryItems in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public ReadOnly Property InventoryItems() As Global.System.Data.Services.Client.DataServiceQuery(Of InventoryItem)
            Get
                If (Me._InventoryItems Is Nothing) Then
                    Me._InventoryItems = MyBase.CreateQuery(Of InventoryItem)("InventoryItems")
                End If
                Return Me._InventoryItems
            End Get
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _InventoryItems As Global.System.Data.Services.Client.DataServiceQuery(Of InventoryItem)
        '''<summary>
        '''There are no comments for Customers in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Sub AddToCustomers(ByVal customer As Customer)
            MyBase.AddObject("Customers", customer)
        End Sub
        '''<summary>
        '''There are no comments for States in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Sub AddToStates(ByVal state As State)
            MyBase.AddObject("States", state)
        End Sub
        '''<summary>
        '''There are no comments for Appointments in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Sub AddToAppointments(ByVal appointment As Appointment)
            MyBase.AddObject("Appointments", appointment)
        End Sub
        '''<summary>
        '''There are no comments for Employees in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Sub AddToEmployees(ByVal employee As Employee)
            MyBase.AddObject("Employees", employee)
        End Sub
        '''<summary>
        '''There are no comments for Photos in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Sub AddToPhotos(ByVal photo As Photo)
            MyBase.AddObject("Photos", photo)
        End Sub
        '''<summary>
        '''There are no comments for Rooms in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Sub AddToRooms(ByVal room As Room)
            MyBase.AddObject("Rooms", room)
        End Sub
        '''<summary>
        '''There are no comments for InventoryItems in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Sub AddToInventoryItems(ByVal inventoryItem As InventoryItem)
            MyBase.AddObject("InventoryItems", inventoryItem)
        End Sub
    End Class
    '''<summary>
    '''There are no comments for LightSwitchApplication.Customer in the schema.
    '''</summary>
    '''<KeyProperties>
    '''Id
    '''</KeyProperties>
    <Global.System.Data.Services.Common.EntitySetAttribute("Customers"),  _
     Global.System.Data.Services.Common.DataServiceKeyAttribute("Id")>  _
    Partial Public Class Customer
        Inherits Global.Microsoft.LightSwitch.ClientGenerated.Implementation.EntityBase
        Implements Global.System.ComponentModel.INotifyPropertyChanged
        '''<summary>
        '''Create a new Customer object.
        '''</summary>
        '''<param name="ID">Initial value of Id.</param>
        '''<param name="rowVersion">Initial value of RowVersion.</param>
        '''<param name="lastName">Initial value of LastName.</param>
        '''<param name="firstName">Initial value of FirstName.</param>
        '''<param name="phone">Initial value of Phone.</param>
        '''<param name="street">Initial value of Street.</param>
        '''<param name="city">Initial value of City.</param>
        '''<param name="postalCode">Initial value of PostalCode.</param>
        '''<param name="customer_State">Initial value of Customer_State.</param>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Shared Function CreateCustomer(ByVal ID As Integer, ByVal rowVersion() As Byte, ByVal lastName As String, ByVal firstName As String, ByVal phone As String, ByVal street As String, ByVal city As String, ByVal postalCode As String, ByVal customer_State As Integer) 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
        '''<summary>
        '''There are no comments for Property Id in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Id() As Integer
            Get
                Return Me._Id
            End Get
            Set
                Me.OnIdChanging(value)
                If Object.Equals(Me.Id, value) Then
                    Return
                End If
                Me._Id = value
                Me.OnIdChanged
                Me.OnPropertyChanged("Id")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Id As Integer
        Partial Private Sub OnIdChanging(ByVal value As Integer)
        End Sub
        Partial Private Sub OnIdChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property RowVersion in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property RowVersion() As Byte()
            Get
                If (Not (Me._RowVersion) Is Nothing) Then
                    Return CType(Me._RowVersion.Clone,Byte())
                Else
                    Return Nothing
                End If
            End Get
            Set
                Me.OnRowVersionChanging(value)
                If Object.Equals(Me.RowVersion, value) Then
                    Return
                End If
                Me._RowVersion = value
                Me.OnRowVersionChanged
                Me.OnPropertyChanged("RowVersion")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _RowVersion() As Byte
        Partial Private Sub OnRowVersionChanging(ByVal value() As Byte)
        End Sub
        Partial Private Sub OnRowVersionChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property LastName in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property LastName() As String
            Get
                Return Me._LastName
            End Get
            Set
                Me.OnLastNameChanging(value)
                If Object.Equals(Me.LastName, value) Then
                    Return
                End If
                Me._LastName = value
                Me.OnLastNameChanged
                Me.OnPropertyChanged("LastName")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _LastName As String
        Partial Private Sub OnLastNameChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnLastNameChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property FirstName in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property FirstName() As String
            Get
                Return Me._FirstName
            End Get
            Set
                Me.OnFirstNameChanging(value)
                If Object.Equals(Me.FirstName, value) Then
                    Return
                End If
                Me._FirstName = value
                Me.OnFirstNameChanged
                Me.OnPropertyChanged("FirstName")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _FirstName As String
        Partial Private Sub OnFirstNameChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnFirstNameChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Phone in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Phone() As String
            Get
                Return Me._Phone
            End Get
            Set
                Me.OnPhoneChanging(value)
                If Object.Equals(Me.Phone, value) Then
                    Return
                End If
                Me._Phone = value
                Me.OnPhoneChanged
                Me.OnPropertyChanged("Phone")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Phone As String
        Partial Private Sub OnPhoneChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnPhoneChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Email in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Email() As String
            Get
                Return Me._Email
            End Get
            Set
                Me.OnEmailChanging(value)
                If Object.Equals(Me.Email, value) Then
                    Return
                End If
                Me._Email = value
                Me.OnEmailChanged
                Me.OnPropertyChanged("Email")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Email As String
        Partial Private Sub OnEmailChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnEmailChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Street in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Street() As String
            Get
                Return Me._Street
            End Get
            Set
                Me.OnStreetChanging(value)
                If Object.Equals(Me.Street, value) Then
                    Return
                End If
                Me._Street = value
                Me.OnStreetChanged
                Me.OnPropertyChanged("Street")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Street As String
        Partial Private Sub OnStreetChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnStreetChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property StreetLine2 in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property StreetLine2() As String
            Get
                Return Me._StreetLine2
            End Get
            Set
                Me.OnStreetLine2Changing(value)
                If Object.Equals(Me.StreetLine2, value) Then
                    Return
                End If
                Me._StreetLine2 = value
                Me.OnStreetLine2Changed
                Me.OnPropertyChanged("StreetLine2")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _StreetLine2 As String
        Partial Private Sub OnStreetLine2Changing(ByVal value As String)
        End Sub
        Partial Private Sub OnStreetLine2Changed()
        End Sub
        '''<summary>
        '''There are no comments for Property City in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property City() As String
            Get
                Return Me._City
            End Get
            Set
                Me.OnCityChanging(value)
                If Object.Equals(Me.City, value) Then
                    Return
                End If
                Me._City = value
                Me.OnCityChanged
                Me.OnPropertyChanged("City")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _City As String
        Partial Private Sub OnCityChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnCityChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property PostalCode in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property PostalCode() As String
            Get
                Return Me._PostalCode
            End Get
            Set
                Me.OnPostalCodeChanging(value)
                If Object.Equals(Me.PostalCode, value) Then
                    Return
                End If
                Me._PostalCode = value
                Me.OnPostalCodeChanged
                Me.OnPropertyChanged("PostalCode")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _PostalCode As String
        Partial Private Sub OnPostalCodeChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnPostalCodeChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Customer_State in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Customer_State() As Integer
            Get
                Return Me._Customer_State
            End Get
            Set
                Me.OnCustomer_StateChanging(value)
                If Object.Equals(Me.Customer_State, value) Then
                    Return
                End If
                Me._Customer_State = value
                Me.OnCustomer_StateChanged
                Me.OnPropertyChanged("Customer_State")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Customer_State As Integer
        Partial Private Sub OnCustomer_StateChanging(ByVal value As Integer)
        End Sub
        Partial Private Sub OnCustomer_StateChanged()
        End Sub
        '''<summary>
        '''There are no comments for State in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property State() As State
            Get
                Me.__State.EnsureValueInitialized
                Return Me._State
            End Get
            Set
                Dim previous As State = Me.State
                If (previous Is value) Then
                    Return
                End If
                If (Not (previous) Is Nothing) Then
                    Me._State = Nothing
                    Me.__State.OnValueSet
                    previous.Customers.Remove(Me)
                End If
                If (Not (Me.___Host) Is Nothing) Then
                    If (Not (value) Is Nothing) Then
                        Me.Customer_State = value.Id
                    Else
                        Me.Customer_State = CType(Nothing, Integer)
                    End If
                End If
                Me._State = value
                Me.__State.OnValueSet
                If (Not (value) Is Nothing) Then
                    value.__Customers.Add(Me)
                End If
                Me.___OnPropertyChanged("State")
                Me.OnPropertyChanged("State")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _State As State
        '''<summary>
        '''There are no comments for Appointments in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Appointments() As Global.System.Data.Services.Client.DataServiceCollection(Of Appointment)
            Get
                Me.__Appointments.EnsureValueInitialized
                Return Me._Appointments
            End Get
            Set
                Me._Appointments = value
                Me.OnPropertyChanged("Appointments")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Appointments As Global.System.Data.Services.Client.DataServiceCollection(Of Appointment) = New Global.System.Data.Services.Client.DataServiceCollection(Of Appointment)(Nothing, Global.System.Data.Services.Client.TrackingMode.None)
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Event PropertyChanged As Global.System.ComponentModel.PropertyChangedEventHandler Implements Global.System.ComponentModel.INotifyPropertyChanged.PropertyChanged
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Protected Overridable Sub OnPropertyChanged(ByVal [property] As String)
            If (Not (Me.PropertyChangedEvent) Is Nothing) Then
                RaiseEvent PropertyChanged(Me, New Global.System.ComponentModel.PropertyChangedEventArgs([property]))
            End If
        End Sub
    End Class
    '''<summary>
    '''There are no comments for LightSwitchApplication.State in the schema.
    '''</summary>
    '''<KeyProperties>
    '''Id
    '''</KeyProperties>
    <Global.System.Data.Services.Common.EntitySetAttribute("States"),  _
     Global.System.Data.Services.Common.DataServiceKeyAttribute("Id")>  _
    Partial Public Class State
        Inherits Global.Microsoft.LightSwitch.ClientGenerated.Implementation.EntityBase
        Implements Global.System.ComponentModel.INotifyPropertyChanged
        '''<summary>
        '''Create a new State object.
        '''</summary>
        '''<param name="ID">Initial value of Id.</param>
        '''<param name="rowVersion">Initial value of RowVersion.</param>
        '''<param name="name">Initial value of Name.</param>
        '''<param name="abbreviation">Initial value of Abbreviation.</param>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Shared Function CreateState(ByVal ID As Integer, ByVal rowVersion() As Byte, ByVal name As String, ByVal abbreviation As 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
        '''<summary>
        '''There are no comments for Property Id in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Id() As Integer
            Get
                Return Me._Id
            End Get
            Set
                Me.OnIdChanging(value)
                If Object.Equals(Me.Id, value) Then
                    Return
                End If
                Me._Id = value
                Me.OnIdChanged
                Me.OnPropertyChanged("Id")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Id As Integer
        Partial Private Sub OnIdChanging(ByVal value As Integer)
        End Sub
        Partial Private Sub OnIdChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property RowVersion in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property RowVersion() As Byte()
            Get
                If (Not (Me._RowVersion) Is Nothing) Then
                    Return CType(Me._RowVersion.Clone,Byte())
                Else
                    Return Nothing
                End If
            End Get
            Set
                Me.OnRowVersionChanging(value)
                If Object.Equals(Me.RowVersion, value) Then
                    Return
                End If
                Me._RowVersion = value
                Me.OnRowVersionChanged
                Me.OnPropertyChanged("RowVersion")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _RowVersion() As Byte
        Partial Private Sub OnRowVersionChanging(ByVal value() As Byte)
        End Sub
        Partial Private Sub OnRowVersionChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Name in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Name() As String
            Get
                Return Me._Name
            End Get
            Set
                Me.OnNameChanging(value)
                If Object.Equals(Me.Name, value) Then
                    Return
                End If
                Me._Name = value
                Me.OnNameChanged
                Me.OnPropertyChanged("Name")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Name As String
        Partial Private Sub OnNameChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnNameChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Abbreviation in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Abbreviation() As String
            Get
                Return Me._Abbreviation
            End Get
            Set
                Me.OnAbbreviationChanging(value)
                If Object.Equals(Me.Abbreviation, value) Then
                    Return
                End If
                Me._Abbreviation = value
                Me.OnAbbreviationChanged
                Me.OnPropertyChanged("Abbreviation")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Abbreviation As String
        Partial Private Sub OnAbbreviationChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnAbbreviationChanged()
        End Sub
        '''<summary>
        '''There are no comments for Customers in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Customers() As Global.System.Data.Services.Client.DataServiceCollection(Of Customer)
            Get
                Me.__Customers.EnsureValueInitialized
                Return Me._Customers
            End Get
            Set
                Me._Customers = value
                Me.OnPropertyChanged("Customers")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Customers As Global.System.Data.Services.Client.DataServiceCollection(Of Customer) = New Global.System.Data.Services.Client.DataServiceCollection(Of Customer)(Nothing, Global.System.Data.Services.Client.TrackingMode.None)
        '''<summary>
        '''There are no comments for Appointments in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Appointments() As Global.System.Data.Services.Client.DataServiceCollection(Of Appointment)
            Get
                Me.__Appointments.EnsureValueInitialized
                Return Me._Appointments
            End Get
            Set
                Me._Appointments = value
                Me.OnPropertyChanged("Appointments")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Appointments As Global.System.Data.Services.Client.DataServiceCollection(Of Appointment) = New Global.System.Data.Services.Client.DataServiceCollection(Of Appointment)(Nothing, Global.System.Data.Services.Client.TrackingMode.None)
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Event PropertyChanged As Global.System.ComponentModel.PropertyChangedEventHandler Implements Global.System.ComponentModel.INotifyPropertyChanged.PropertyChanged
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Protected Overridable Sub OnPropertyChanged(ByVal [property] As String)
            If (Not (Me.PropertyChangedEvent) Is Nothing) Then
                RaiseEvent PropertyChanged(Me, New Global.System.ComponentModel.PropertyChangedEventArgs([property]))
            End If
        End Sub
    End Class
    '''<summary>
    '''There are no comments for LightSwitchApplication.Appointment in the schema.
    '''</summary>
    '''<KeyProperties>
    '''Id
    '''</KeyProperties>
    <Global.System.Data.Services.Common.EntitySetAttribute("Appointments"),  _
     Global.System.Data.Services.Common.DataServiceKeyAttribute("Id")>  _
    Partial Public Class Appointment
        Inherits Global.Microsoft.LightSwitch.ClientGenerated.Implementation.EntityBase
        Implements Global.System.ComponentModel.INotifyPropertyChanged
        '''<summary>
        '''Create a new Appointment object.
        '''</summary>
        '''<param name="ID">Initial value of Id.</param>
        '''<param name="rowVersion">Initial value of RowVersion.</param>
        '''<param name="startDate">Initial value of StartDate.</param>
        '''<param name="endDate">Initial value of EndDate.</param>
        '''<param name="street">Initial value of Street.</param>
        '''<param name="city">Initial value of City.</param>
        '''<param name="postalCode">Initial value of PostalCode.</param>
        '''<param name="moveType">Initial value of MoveType.</param>
        '''<param name="appointment_State">Initial value of Appointment_State.</param>
        '''<param name="appointment_Customer">Initial value of Appointment_Customer.</param>
        '''<param name="appointment_Employee">Initial value of Appointment_Employee.</param>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Shared Function CreateAppointment(ByVal ID As Integer, ByVal rowVersion() As Byte, ByVal startDate As Date, ByVal endDate As Date, ByVal street As String, ByVal city As String, ByVal postalCode As String, ByVal moveType As String, ByVal appointment_State As Integer, ByVal appointment_Customer As Integer, ByVal appointment_Employee As Integer) 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
        '''<summary>
        '''There are no comments for Property Id in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Id() As Integer
            Get
                Return Me._Id
            End Get
            Set
                Me.OnIdChanging(value)
                If Object.Equals(Me.Id, value) Then
                    Return
                End If
                Me._Id = value
                Me.OnIdChanged
                Me.OnPropertyChanged("Id")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Id As Integer
        Partial Private Sub OnIdChanging(ByVal value As Integer)
        End Sub
        Partial Private Sub OnIdChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property RowVersion in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property RowVersion() As Byte()
            Get
                If (Not (Me._RowVersion) Is Nothing) Then
                    Return CType(Me._RowVersion.Clone,Byte())
                Else
                    Return Nothing
                End If
            End Get
            Set
                Me.OnRowVersionChanging(value)
                If Object.Equals(Me.RowVersion, value) Then
                    Return
                End If
                Me._RowVersion = value
                Me.OnRowVersionChanged
                Me.OnPropertyChanged("RowVersion")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _RowVersion() As Byte
        Partial Private Sub OnRowVersionChanging(ByVal value() As Byte)
        End Sub
        Partial Private Sub OnRowVersionChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property StartDate in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property StartDate() As Date
            Get
                Return Me._StartDate
            End Get
            Set
                Me.OnStartDateChanging(value)
                If Object.Equals(Me.StartDate, value) Then
                    Return
                End If
                Me._StartDate = value
                Me.OnStartDateChanged
                Me.OnPropertyChanged("StartDate")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _StartDate As Date
        Partial Private Sub OnStartDateChanging(ByVal value As Date)
        End Sub
        Partial Private Sub OnStartDateChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property EndDate in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property EndDate() As Date
            Get
                Return Me._EndDate
            End Get
            Set
                Me.OnEndDateChanging(value)
                If Object.Equals(Me.EndDate, value) Then
                    Return
                End If
                Me._EndDate = value
                Me.OnEndDateChanged
                Me.OnPropertyChanged("EndDate")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _EndDate As Date
        Partial Private Sub OnEndDateChanging(ByVal value As Date)
        End Sub
        Partial Private Sub OnEndDateChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Street in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Street() As String
            Get
                Return Me._Street
            End Get
            Set
                Me.OnStreetChanging(value)
                If Object.Equals(Me.Street, value) Then
                    Return
                End If
                Me._Street = value
                Me.OnStreetChanged
                Me.OnPropertyChanged("Street")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Street As String
        Partial Private Sub OnStreetChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnStreetChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property StreetLine2 in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property StreetLine2() As String
            Get
                Return Me._StreetLine2
            End Get
            Set
                Me.OnStreetLine2Changing(value)
                If Object.Equals(Me.StreetLine2, value) Then
                    Return
                End If
                Me._StreetLine2 = value
                Me.OnStreetLine2Changed
                Me.OnPropertyChanged("StreetLine2")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _StreetLine2 As String
        Partial Private Sub OnStreetLine2Changing(ByVal value As String)
        End Sub
        Partial Private Sub OnStreetLine2Changed()
        End Sub
        '''<summary>
        '''There are no comments for Property City in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property City() As String
            Get
                Return Me._City
            End Get
            Set
                Me.OnCityChanging(value)
                If Object.Equals(Me.City, value) Then
                    Return
                End If
                Me._City = value
                Me.OnCityChanged
                Me.OnPropertyChanged("City")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _City As String
        Partial Private Sub OnCityChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnCityChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property PostalCode in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property PostalCode() As String
            Get
                Return Me._PostalCode
            End Get
            Set
                Me.OnPostalCodeChanging(value)
                If Object.Equals(Me.PostalCode, value) Then
                    Return
                End If
                Me._PostalCode = value
                Me.OnPostalCodeChanged
                Me.OnPropertyChanged("PostalCode")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _PostalCode As String
        Partial Private Sub OnPostalCodeChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnPostalCodeChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Notes in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Notes() As String
            Get
                Return Me._Notes
            End Get
            Set
                Me.OnNotesChanging(value)
                If Object.Equals(Me.Notes, value) Then
                    Return
                End If
                Me._Notes = value
                Me.OnNotesChanged
                Me.OnPropertyChanged("Notes")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Notes As String
        Partial Private Sub OnNotesChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnNotesChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property MoveType in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property MoveType() As String
            Get
                Return Me._MoveType
            End Get
            Set
                Me.OnMoveTypeChanging(value)
                If Object.Equals(Me.MoveType, value) Then
                    Return
                End If
                Me._MoveType = value
                Me.OnMoveTypeChanged
                Me.OnPropertyChanged("MoveType")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _MoveType As String
        Partial Private Sub OnMoveTypeChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnMoveTypeChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Appointment_State in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Appointment_State() As Integer
            Get
                Return Me._Appointment_State
            End Get
            Set
                Me.OnAppointment_StateChanging(value)
                If Object.Equals(Me.Appointment_State, value) Then
                    Return
                End If
                Me._Appointment_State = value
                Me.OnAppointment_StateChanged
                Me.OnPropertyChanged("Appointment_State")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Appointment_State As Integer
        Partial Private Sub OnAppointment_StateChanging(ByVal value As Integer)
        End Sub
        Partial Private Sub OnAppointment_StateChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Appointment_Customer in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Appointment_Customer() As Integer
            Get
                Return Me._Appointment_Customer
            End Get
            Set
                Me.OnAppointment_CustomerChanging(value)
                If Object.Equals(Me.Appointment_Customer, value) Then
                    Return
                End If
                Me._Appointment_Customer = value
                Me.OnAppointment_CustomerChanged
                Me.OnPropertyChanged("Appointment_Customer")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Appointment_Customer As Integer
        Partial Private Sub OnAppointment_CustomerChanging(ByVal value As Integer)
        End Sub
        Partial Private Sub OnAppointment_CustomerChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Appointment_Employee in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Appointment_Employee() As Integer
            Get
                Return Me._Appointment_Employee
            End Get
            Set
                Me.OnAppointment_EmployeeChanging(value)
                If Object.Equals(Me.Appointment_Employee, value) Then
                    Return
                End If
                Me._Appointment_Employee = value
                Me.OnAppointment_EmployeeChanged
                Me.OnPropertyChanged("Appointment_Employee")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Appointment_Employee As Integer
        Partial Private Sub OnAppointment_EmployeeChanging(ByVal value As Integer)
        End Sub
        Partial Private Sub OnAppointment_EmployeeChanged()
        End Sub
        '''<summary>
        '''There are no comments for State in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property State() As State
            Get
                Me.__State.EnsureValueInitialized
                Return Me._State
            End Get
            Set
                Dim previous As State = Me.State
                If (previous Is value) Then
                    Return
                End If
                If (Not (previous) Is Nothing) Then
                    Me._State = Nothing
                    Me.__State.OnValueSet
                    previous.Appointments.Remove(Me)
                End If
                If (Not (Me.___Host) Is Nothing) Then
                    If (Not (value) Is Nothing) Then
                        Me.Appointment_State = value.Id
                    Else
                        Me.Appointment_State = CType(Nothing, Integer)
                    End If
                End If
                Me._State = value
                Me.__State.OnValueSet
                If (Not (value) Is Nothing) Then
                    value.__Appointments.Add(Me)
                End If
                Me.___OnPropertyChanged("State")
                Me.OnPropertyChanged("State")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _State As State
        '''<summary>
        '''There are no comments for Photos in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Photos() As Global.System.Data.Services.Client.DataServiceCollection(Of Photo)
            Get
                Me.__Photos.EnsureValueInitialized
                Return Me._Photos
            End Get
            Set
                Me._Photos = value
                Me.OnPropertyChanged("Photos")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Photos As Global.System.Data.Services.Client.DataServiceCollection(Of Photo) = New Global.System.Data.Services.Client.DataServiceCollection(Of Photo)(Nothing, Global.System.Data.Services.Client.TrackingMode.None)
        '''<summary>
        '''There are no comments for Employee in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Employee() As Employee
            Get
                Me.__Employee.EnsureValueInitialized
                Return Me._Employee
            End Get
            Set
                Dim previous As Employee = Me.Employee
                If (previous Is value) Then
                    Return
                End If
                If (Not (previous) Is Nothing) Then
                    Me._Employee = Nothing
                    Me.__Employee.OnValueSet
                    previous.Appointments.Remove(Me)
                End If
                If (Not (Me.___Host) Is Nothing) Then
                    If (Not (value) Is Nothing) Then
                        Me.Appointment_Employee = value.Id
                    Else
                        Me.Appointment_Employee = CType(Nothing, Integer)
                    End If
                End If
                Me._Employee = value
                Me.__Employee.OnValueSet
                If (Not (value) Is Nothing) Then
                    value.__Appointments.Add(Me)
                End If
                Me.___OnPropertyChanged("Employee")
                Me.OnPropertyChanged("Employee")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Employee As Employee
        '''<summary>
        '''There are no comments for Rooms in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Rooms() As Global.System.Data.Services.Client.DataServiceCollection(Of Room)
            Get
                Me.__Rooms.EnsureValueInitialized
                Return Me._Rooms
            End Get
            Set
                Me._Rooms = value
                Me.OnPropertyChanged("Rooms")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Rooms As Global.System.Data.Services.Client.DataServiceCollection(Of Room) = New Global.System.Data.Services.Client.DataServiceCollection(Of Room)(Nothing, Global.System.Data.Services.Client.TrackingMode.None)
        '''<summary>
        '''There are no comments for Customer in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Customer() As Customer
            Get
                Me.__Customer.EnsureValueInitialized
                Return Me._Customer
            End Get
            Set
                Dim previous As Customer = Me.Customer
                If (previous Is value) Then
                    Return
                End If
                If (Not (previous) Is Nothing) Then
                    Me._Customer = Nothing
                    Me.__Customer.OnValueSet
                    previous.Appointments.Remove(Me)
                End If
                If (Not (Me.___Host) Is Nothing) Then
                    If (Not (value) Is Nothing) Then
                        Me.Appointment_Customer = value.Id
                    Else
                        Me.Appointment_Customer = CType(Nothing, Integer)
                    End If
                End If
                Me._Customer = value
                Me.__Customer.OnValueSet
                If (Not (value) Is Nothing) Then
                    value.__Appointments.Add(Me)
                End If
                Me.___OnPropertyChanged("Customer")
                Me.OnPropertyChanged("Customer")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Customer As Customer
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Event PropertyChanged As Global.System.ComponentModel.PropertyChangedEventHandler Implements Global.System.ComponentModel.INotifyPropertyChanged.PropertyChanged
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Protected Overridable Sub OnPropertyChanged(ByVal [property] As String)
            If (Not (Me.PropertyChangedEvent) Is Nothing) Then
                RaiseEvent PropertyChanged(Me, New Global.System.ComponentModel.PropertyChangedEventArgs([property]))
            End If
        End Sub
    End Class
    '''<summary>
    '''There are no comments for LightSwitchApplication.Employee in the schema.
    '''</summary>
    '''<KeyProperties>
    '''Id
    '''</KeyProperties>
    <Global.System.Data.Services.Common.EntitySetAttribute("Employees"),  _
     Global.System.Data.Services.Common.DataServiceKeyAttribute("Id")>  _
    Partial Public Class Employee
        Inherits Global.Microsoft.LightSwitch.ClientGenerated.Implementation.EntityBase
        Implements Global.System.ComponentModel.INotifyPropertyChanged
        '''<summary>
        '''Create a new Employee object.
        '''</summary>
        '''<param name="ID">Initial value of Id.</param>
        '''<param name="rowVersion">Initial value of RowVersion.</param>
        '''<param name="firstName">Initial value of FirstName.</param>
        '''<param name="lastName">Initial value of LastName.</param>
        '''<param name="userName">Initial value of UserName.</param>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Shared Function CreateEmployee(ByVal ID As Integer, ByVal rowVersion() As Byte, ByVal firstName As String, ByVal lastName As String, ByVal userName As 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
        '''<summary>
        '''There are no comments for Property Id in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Id() As Integer
            Get
                Return Me._Id
            End Get
            Set
                Me.OnIdChanging(value)
                If Object.Equals(Me.Id, value) Then
                    Return
                End If
                Me._Id = value
                Me.OnIdChanged
                Me.OnPropertyChanged("Id")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Id As Integer
        Partial Private Sub OnIdChanging(ByVal value As Integer)
        End Sub
        Partial Private Sub OnIdChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property RowVersion in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property RowVersion() As Byte()
            Get
                If (Not (Me._RowVersion) Is Nothing) Then
                    Return CType(Me._RowVersion.Clone,Byte())
                Else
                    Return Nothing
                End If
            End Get
            Set
                Me.OnRowVersionChanging(value)
                If Object.Equals(Me.RowVersion, value) Then
                    Return
                End If
                Me._RowVersion = value
                Me.OnRowVersionChanged
                Me.OnPropertyChanged("RowVersion")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _RowVersion() As Byte
        Partial Private Sub OnRowVersionChanging(ByVal value() As Byte)
        End Sub
        Partial Private Sub OnRowVersionChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property FirstName in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property FirstName() As String
            Get
                Return Me._FirstName
            End Get
            Set
                Me.OnFirstNameChanging(value)
                If Object.Equals(Me.FirstName, value) Then
                    Return
                End If
                Me._FirstName = value
                Me.OnFirstNameChanged
                Me.OnPropertyChanged("FirstName")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _FirstName As String
        Partial Private Sub OnFirstNameChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnFirstNameChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property LastName in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property LastName() As String
            Get
                Return Me._LastName
            End Get
            Set
                Me.OnLastNameChanging(value)
                If Object.Equals(Me.LastName, value) Then
                    Return
                End If
                Me._LastName = value
                Me.OnLastNameChanged
                Me.OnPropertyChanged("LastName")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _LastName As String
        Partial Private Sub OnLastNameChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnLastNameChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property UserName in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property UserName() As String
            Get
                Return Me._UserName
            End Get
            Set
                Me.OnUserNameChanging(value)
                If Object.Equals(Me.UserName, value) Then
                    Return
                End If
                Me._UserName = value
                Me.OnUserNameChanged
                Me.OnPropertyChanged("UserName")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _UserName As String
        Partial Private Sub OnUserNameChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnUserNameChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Email in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Email() As String
            Get
                Return Me._Email
            End Get
            Set
                Me.OnEmailChanging(value)
                If Object.Equals(Me.Email, value) Then
                    Return
                End If
                Me._Email = value
                Me.OnEmailChanged
                Me.OnPropertyChanged("Email")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Email As String
        Partial Private Sub OnEmailChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnEmailChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Phone in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Phone() As String
            Get
                Return Me._Phone
            End Get
            Set
                Me.OnPhoneChanging(value)
                If Object.Equals(Me.Phone, value) Then
                    Return
                End If
                Me._Phone = value
                Me.OnPhoneChanged
                Me.OnPropertyChanged("Phone")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Phone As String
        Partial Private Sub OnPhoneChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnPhoneChanged()
        End Sub
        '''<summary>
        '''There are no comments for Appointments in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Appointments() As Global.System.Data.Services.Client.DataServiceCollection(Of Appointment)
            Get
                Me.__Appointments.EnsureValueInitialized
                Return Me._Appointments
            End Get
            Set
                Me._Appointments = value
                Me.OnPropertyChanged("Appointments")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Appointments As Global.System.Data.Services.Client.DataServiceCollection(Of Appointment) = New Global.System.Data.Services.Client.DataServiceCollection(Of Appointment)(Nothing, Global.System.Data.Services.Client.TrackingMode.None)
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Event PropertyChanged As Global.System.ComponentModel.PropertyChangedEventHandler Implements Global.System.ComponentModel.INotifyPropertyChanged.PropertyChanged
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Protected Overridable Sub OnPropertyChanged(ByVal [property] As String)
            If (Not (Me.PropertyChangedEvent) Is Nothing) Then
                RaiseEvent PropertyChanged(Me, New Global.System.ComponentModel.PropertyChangedEventArgs([property]))
            End If
        End Sub
    End Class
    '''<summary>
    '''There are no comments for LightSwitchApplication.Photo in the schema.
    '''</summary>
    '''<KeyProperties>
    '''Id
    '''</KeyProperties>
    <Global.System.Data.Services.Common.EntitySetAttribute("Photos"),  _
     Global.System.Data.Services.Common.DataServiceKeyAttribute("Id")>  _
    Partial Public Class Photo
        Inherits Global.Microsoft.LightSwitch.ClientGenerated.Implementation.EntityBase
        Implements Global.System.ComponentModel.INotifyPropertyChanged
        '''<summary>
        '''Create a new Photo object.
        '''</summary>
        '''<param name="ID">Initial value of Id.</param>
        '''<param name="rowVersion">Initial value of RowVersion.</param>
        '''<param name="appointmentPhoto_Appointment">Initial value of AppointmentPhoto_Appointment.</param>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Shared Function CreatePhoto(ByVal ID As Integer, ByVal rowVersion() As Byte, ByVal appointmentPhoto_Appointment As Integer) As Photo
            Dim photo As Photo = New Photo()
            photo.Id = ID
            photo.RowVersion = rowVersion
            photo.AppointmentPhoto_Appointment = appointmentPhoto_Appointment
            Return photo
        End Function
        '''<summary>
        '''There are no comments for Property Id in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Id() As Integer
            Get
                Return Me._Id
            End Get
            Set
                Me.OnIdChanging(value)
                If Object.Equals(Me.Id, value) Then
                    Return
                End If
                Me._Id = value
                Me.OnIdChanged
                Me.OnPropertyChanged("Id")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Id As Integer
        Partial Private Sub OnIdChanging(ByVal value As Integer)
        End Sub
        Partial Private Sub OnIdChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property RowVersion in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property RowVersion() As Byte()
            Get
                If (Not (Me._RowVersion) Is Nothing) Then
                    Return CType(Me._RowVersion.Clone,Byte())
                Else
                    Return Nothing
                End If
            End Get
            Set
                Me.OnRowVersionChanging(value)
                If Object.Equals(Me.RowVersion, value) Then
                    Return
                End If
                Me._RowVersion = value
                Me.OnRowVersionChanged
                Me.OnPropertyChanged("RowVersion")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _RowVersion() As Byte
        Partial Private Sub OnRowVersionChanging(ByVal value() As Byte)
        End Sub
        Partial Private Sub OnRowVersionChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Picture in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Picture() As Byte()
            Get
                If (Not (Me._Picture) Is Nothing) Then
                    Return CType(Me._Picture.Clone,Byte())
                Else
                    Return Nothing
                End If
            End Get
            Set
                Me.OnPictureChanging(value)
                If Object.Equals(Me.Picture, value) Then
                    Return
                End If
                Me._Picture = value
                Me.OnPictureChanged
                Me.OnPropertyChanged("Picture")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Picture() As Byte
        Partial Private Sub OnPictureChanging(ByVal value() As Byte)
        End Sub
        Partial Private Sub OnPictureChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Caption in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Caption() As String
            Get
                Return Me._Caption
            End Get
            Set
                Me.OnCaptionChanging(value)
                If Object.Equals(Me.Caption, value) Then
                    Return
                End If
                Me._Caption = value
                Me.OnCaptionChanged
                Me.OnPropertyChanged("Caption")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Caption As String
        Partial Private Sub OnCaptionChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnCaptionChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property AppointmentPhoto_Appointment in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property AppointmentPhoto_Appointment() As Integer
            Get
                Return Me._AppointmentPhoto_Appointment
            End Get
            Set
                Me.OnAppointmentPhoto_AppointmentChanging(value)
                If Object.Equals(Me.AppointmentPhoto_Appointment, value) Then
                    Return
                End If
                Me._AppointmentPhoto_Appointment = value
                Me.OnAppointmentPhoto_AppointmentChanged
                Me.OnPropertyChanged("AppointmentPhoto_Appointment")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _AppointmentPhoto_Appointment As Integer
        Partial Private Sub OnAppointmentPhoto_AppointmentChanging(ByVal value As Integer)
        End Sub
        Partial Private Sub OnAppointmentPhoto_AppointmentChanged()
        End Sub
        '''<summary>
        '''There are no comments for Appointment in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Appointment() As Appointment
            Get
                Me.__Appointment.EnsureValueInitialized
                Return Me._Appointment
            End Get
            Set
                Dim previous As Appointment = Me.Appointment
                If (previous Is value) Then
                    Return
                End If
                If (Not (previous) Is Nothing) Then
                    Me._Appointment = Nothing
                    Me.__Appointment.OnValueSet
                    previous.Photos.Remove(Me)
                End If
                If (Not (Me.___Host) Is Nothing) Then
                    If (Not (value) Is Nothing) Then
                        Me.AppointmentPhoto_Appointment = value.Id
                    Else
                        Me.AppointmentPhoto_Appointment = CType(Nothing, Integer)
                    End If
                End If
                Me._Appointment = value
                Me.__Appointment.OnValueSet
                If (Not (value) Is Nothing) Then
                    value.__Photos.Add(Me)
                End If
                Me.___OnPropertyChanged("Appointment")
                Me.OnPropertyChanged("Appointment")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Appointment As Appointment
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Event PropertyChanged As Global.System.ComponentModel.PropertyChangedEventHandler Implements Global.System.ComponentModel.INotifyPropertyChanged.PropertyChanged
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Protected Overridable Sub OnPropertyChanged(ByVal [property] As String)
            If (Not (Me.PropertyChangedEvent) Is Nothing) Then
                RaiseEvent PropertyChanged(Me, New Global.System.ComponentModel.PropertyChangedEventArgs([property]))
            End If
        End Sub
    End Class
    '''<summary>
    '''There are no comments for LightSwitchApplication.Room in the schema.
    '''</summary>
    '''<KeyProperties>
    '''Id
    '''</KeyProperties>
    <Global.System.Data.Services.Common.EntitySetAttribute("Rooms"),  _
     Global.System.Data.Services.Common.DataServiceKeyAttribute("Id")>  _
    Partial Public Class Room
        Inherits Global.Microsoft.LightSwitch.ClientGenerated.Implementation.EntityBase
        Implements Global.System.ComponentModel.INotifyPropertyChanged
        '''<summary>
        '''Create a new Room object.
        '''</summary>
        '''<param name="ID">Initial value of Id.</param>
        '''<param name="rowVersion">Initial value of RowVersion.</param>
        '''<param name="name">Initial value of Name.</param>
        '''<param name="appointment_Room">Initial value of Appointment_Room.</param>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Shared Function CreateRoom(ByVal ID As Integer, ByVal rowVersion() As Byte, ByVal name As String, ByVal appointment_Room As Integer) 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
        '''<summary>
        '''There are no comments for Property Id in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Id() As Integer
            Get
                Return Me._Id
            End Get
            Set
                Me.OnIdChanging(value)
                If Object.Equals(Me.Id, value) Then
                    Return
                End If
                Me._Id = value
                Me.OnIdChanged
                Me.OnPropertyChanged("Id")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Id As Integer
        Partial Private Sub OnIdChanging(ByVal value As Integer)
        End Sub
        Partial Private Sub OnIdChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property RowVersion in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property RowVersion() As Byte()
            Get
                If (Not (Me._RowVersion) Is Nothing) Then
                    Return CType(Me._RowVersion.Clone,Byte())
                Else
                    Return Nothing
                End If
            End Get
            Set
                Me.OnRowVersionChanging(value)
                If Object.Equals(Me.RowVersion, value) Then
                    Return
                End If
                Me._RowVersion = value
                Me.OnRowVersionChanged
                Me.OnPropertyChanged("RowVersion")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _RowVersion() As Byte
        Partial Private Sub OnRowVersionChanging(ByVal value() As Byte)
        End Sub
        Partial Private Sub OnRowVersionChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Name in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Name() As String
            Get
                Return Me._Name
            End Get
            Set
                Me.OnNameChanging(value)
                If Object.Equals(Me.Name, value) Then
                    Return
                End If
                Me._Name = value
                Me.OnNameChanged
                Me.OnPropertyChanged("Name")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Name As String
        Partial Private Sub OnNameChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnNameChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Notes in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Notes() As String
            Get
                Return Me._Notes
            End Get
            Set
                Me.OnNotesChanging(value)
                If Object.Equals(Me.Notes, value) Then
                    Return
                End If
                Me._Notes = value
                Me.OnNotesChanged
                Me.OnPropertyChanged("Notes")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Notes As String
        Partial Private Sub OnNotesChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnNotesChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Appointment_Room in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Appointment_Room() As Integer
            Get
                Return Me._Appointment_Room
            End Get
            Set
                Me.OnAppointment_RoomChanging(value)
                If Object.Equals(Me.Appointment_Room, value) Then
                    Return
                End If
                Me._Appointment_Room = value
                Me.OnAppointment_RoomChanged
                Me.OnPropertyChanged("Appointment_Room")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Appointment_Room As Integer
        Partial Private Sub OnAppointment_RoomChanging(ByVal value As Integer)
        End Sub
        Partial Private Sub OnAppointment_RoomChanged()
        End Sub
        '''<summary>
        '''There are no comments for InventoryItems in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property InventoryItems() As Global.System.Data.Services.Client.DataServiceCollection(Of InventoryItem)
            Get
                Me.__InventoryItems.EnsureValueInitialized
                Return Me._InventoryItems
            End Get
            Set
                Me._InventoryItems = value
                Me.OnPropertyChanged("InventoryItems")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _InventoryItems As Global.System.Data.Services.Client.DataServiceCollection(Of InventoryItem) = New Global.System.Data.Services.Client.DataServiceCollection(Of InventoryItem)(Nothing, Global.System.Data.Services.Client.TrackingMode.None)
        '''<summary>
        '''There are no comments for Appointment in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Appointment() As Appointment
            Get
                Me.__Appointment.EnsureValueInitialized
                Return Me._Appointment
            End Get
            Set
                Dim previous As Appointment = Me.Appointment
                If (previous Is value) Then
                    Return
                End If
                If (Not (previous) Is Nothing) Then
                    Me._Appointment = Nothing
                    Me.__Appointment.OnValueSet
                    previous.Rooms.Remove(Me)
                End If
                If (Not (Me.___Host) Is Nothing) Then
                    If (Not (value) Is Nothing) Then
                        Me.Appointment_Room = value.Id
                    Else
                        Me.Appointment_Room = CType(Nothing, Integer)
                    End If
                End If
                Me._Appointment = value
                Me.__Appointment.OnValueSet
                If (Not (value) Is Nothing) Then
                    value.__Rooms.Add(Me)
                End If
                Me.___OnPropertyChanged("Appointment")
                Me.OnPropertyChanged("Appointment")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Appointment As Appointment
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Event PropertyChanged As Global.System.ComponentModel.PropertyChangedEventHandler Implements Global.System.ComponentModel.INotifyPropertyChanged.PropertyChanged
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Protected Overridable Sub OnPropertyChanged(ByVal [property] As String)
            If (Not (Me.PropertyChangedEvent) Is Nothing) Then
                RaiseEvent PropertyChanged(Me, New Global.System.ComponentModel.PropertyChangedEventArgs([property]))
            End If
        End Sub
    End Class
    '''<summary>
    '''There are no comments for LightSwitchApplication.InventoryItem in the schema.
    '''</summary>
    '''<KeyProperties>
    '''Id
    '''</KeyProperties>
    <Global.System.Data.Services.Common.EntitySetAttribute("InventoryItems"),  _
     Global.System.Data.Services.Common.DataServiceKeyAttribute("Id")>  _
    Partial Public Class InventoryItem
        Inherits Global.Microsoft.LightSwitch.ClientGenerated.Implementation.EntityBase
        Implements Global.System.ComponentModel.INotifyPropertyChanged
        '''<summary>
        '''Create a new InventoryItem object.
        '''</summary>
        '''<param name="ID">Initial value of Id.</param>
        '''<param name="rowVersion">Initial value of RowVersion.</param>
        '''<param name="name">Initial value of Name.</param>
        '''<param name="quantity">Initial value of Quantity.</param>
        '''<param name="inventoryItem_Room">Initial value of InventoryItem_Room.</param>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Shared Function CreateInventoryItem(ByVal ID As Integer, ByVal rowVersion() As Byte, ByVal name As String, ByVal quantity As Integer, ByVal inventoryItem_Room As Integer) 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
        '''<summary>
        '''There are no comments for Property Id in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Id() As Integer
            Get
                Return Me._Id
            End Get
            Set
                Me.OnIdChanging(value)
                If Object.Equals(Me.Id, value) Then
                    Return
                End If
                Me._Id = value
                Me.OnIdChanged
                Me.OnPropertyChanged("Id")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Id As Integer
        Partial Private Sub OnIdChanging(ByVal value As Integer)
        End Sub
        Partial Private Sub OnIdChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property RowVersion in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property RowVersion() As Byte()
            Get
                If (Not (Me._RowVersion) Is Nothing) Then
                    Return CType(Me._RowVersion.Clone,Byte())
                Else
                    Return Nothing
                End If
            End Get
            Set
                Me.OnRowVersionChanging(value)
                If Object.Equals(Me.RowVersion, value) Then
                    Return
                End If
                Me._RowVersion = value
                Me.OnRowVersionChanged
                Me.OnPropertyChanged("RowVersion")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _RowVersion() As Byte
        Partial Private Sub OnRowVersionChanging(ByVal value() As Byte)
        End Sub
        Partial Private Sub OnRowVersionChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Name in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Name() As String
            Get
                Return Me._Name
            End Get
            Set
                Me.OnNameChanging(value)
                If Object.Equals(Me.Name, value) Then
                    Return
                End If
                Me._Name = value
                Me.OnNameChanged
                Me.OnPropertyChanged("Name")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Name As String
        Partial Private Sub OnNameChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnNameChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property Quantity in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Quantity() As Integer
            Get
                Return Me._Quantity
            End Get
            Set
                Me.OnQuantityChanging(value)
                If Object.Equals(Me.Quantity, value) Then
                    Return
                End If
                Me._Quantity = value
                Me.OnQuantityChanged
                Me.OnPropertyChanged("Quantity")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Quantity As Integer
        Partial Private Sub OnQuantityChanging(ByVal value As Integer)
        End Sub
        Partial Private Sub OnQuantityChanged()
        End Sub
        '''<summary>
        '''There are no comments for Property InventoryItem_Room in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property InventoryItem_Room() As Integer
            Get
                Return Me._InventoryItem_Room
            End Get
            Set
                Me.OnInventoryItem_RoomChanging(value)
                If Object.Equals(Me.InventoryItem_Room, value) Then
                    Return
                End If
                Me._InventoryItem_Room = value
                Me.OnInventoryItem_RoomChanged
                Me.OnPropertyChanged("InventoryItem_Room")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _InventoryItem_Room As Integer
        Partial Private Sub OnInventoryItem_RoomChanging(ByVal value As Integer)
        End Sub
        Partial Private Sub OnInventoryItem_RoomChanged()
        End Sub
        '''<summary>
        '''There are no comments for Room in the schema.
        '''</summary>
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Property Room() As Room
            Get
                Me.__Room.EnsureValueInitialized
                Return Me._Room
            End Get
            Set
                Dim previous As Room = Me.Room
                If (previous Is value) Then
                    Return
                End If
                If (Not (previous) Is Nothing) Then
                    Me._Room = Nothing
                    Me.__Room.OnValueSet
                    previous.InventoryItems.Remove(Me)
                End If
                If (Not (Me.___Host) Is Nothing) Then
                    If (Not (value) Is Nothing) Then
                        Me.InventoryItem_Room = value.Id
                    Else
                        Me.InventoryItem_Room = CType(Nothing, Integer)
                    End If
                End If
                Me._Room = value
                Me.__Room.OnValueSet
                If (Not (value) Is Nothing) Then
                    value.__InventoryItems.Add(Me)
                End If
                Me.___OnPropertyChanged("Room")
                Me.OnPropertyChanged("Room")
            End Set
        End Property
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Private _Room As Room
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Public Event PropertyChanged As Global.System.ComponentModel.PropertyChangedEventHandler Implements Global.System.ComponentModel.INotifyPropertyChanged.PropertyChanged
        <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")>  _
        Protected Overridable Sub OnPropertyChanged(ByVal [property] As String)
            If (Not (Me.PropertyChangedEvent) Is Nothing) Then
                RaiseEvent PropertyChanged(Me, New Global.System.ComponentModel.PropertyChangedEventArgs([property]))
            End If
        End Sub
    End Class
End Namespace