
Option Compare Binary
Option Infer On
Option Strict On
Option Explicit On

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.ComponentModel.DataAnnotations
Imports System.Data.Objects.DataClasses
Imports System.Linq
Imports System.ServiceModel.DomainServices.Hosting
Imports System.ServiceModel.DomainServices.Server
Imports TutorialsSilverlight.Web


'The MetadataTypeAttribute identifies CategoryMetadata as the class
' that carries additional metadata for the Category class.
<MetadataTypeAttribute(GetType(Category.CategoryMetadata))>  _
Partial Public Class Category
    
    'This class allows you to attach custom attributes to properties
    ' of the Category class.
    '
    'For example, the following marks the Xyz property as a
    ' required property and specifies the format for valid values:
    '    <Required()>
    '    <RegularExpression("[A-Z][A-Za-z0-9]*")>
    '    <StringLength(32)>
    '    Public Property Xyz As String
    Friend NotInheritable Class CategoryMetadata
        
        'Metadata classes are not meant to be instantiated.
        Private Sub New()
            MyBase.New
        End Sub
        
        Public Property CategoryID As Integer
        
        Public Property CategoryName As String
        
        Public Property Description As String
        
        Public Property Picture() As Byte

        <Include()>
        Public Property Products As EntityCollection(Of Product)
    End Class
End Class

'The MetadataTypeAttribute identifies CustomerMetadata as the class
' that carries additional metadata for the Customer class.
<MetadataTypeAttribute(GetType(Customer.CustomerMetadata))>  _
Partial Public Class Customer
    
    'This class allows you to attach custom attributes to properties
    ' of the Customer class.
    '
    'For example, the following marks the Xyz property as a
    ' required property and specifies the format for valid values:
    '    <Required()>
    '    <RegularExpression("[A-Z][A-Za-z0-9]*")>
    '    <StringLength(32)>
    '    Public Property Xyz As String
    Friend NotInheritable Class CustomerMetadata
        
        'Metadata classes are not meant to be instantiated.
        Private Sub New()
            MyBase.New
        End Sub
        
        Public Property Address As String
        
        Public Property City As String
        
        Public Property CompanyName As String
        
        Public Property ContactName As String
        
        Public Property ContactTitle As String
        
        Public Property Country As String
        
        Public Property CustomerDemographics As EntityCollection(Of CustomerDemographic)
        
        Public Property CustomerID As String
        
        Public Property Fax As String
        
        Public Property Orders As EntityCollection(Of Order)
        
        Public Property Phone As String
        
        Public Property PostalCode As String
        
        Public Property Region As String
    End Class
End Class

'The MetadataTypeAttribute identifies CustomerDemographicMetadata as the class
' that carries additional metadata for the CustomerDemographic class.
<MetadataTypeAttribute(GetType(CustomerDemographic.CustomerDemographicMetadata))>  _
Partial Public Class CustomerDemographic
    
    'This class allows you to attach custom attributes to properties
    ' of the CustomerDemographic class.
    '
    'For example, the following marks the Xyz property as a
    ' required property and specifies the format for valid values:
    '    <Required()>
    '    <RegularExpression("[A-Z][A-Za-z0-9]*")>
    '    <StringLength(32)>
    '    Public Property Xyz As String
    Friend NotInheritable Class CustomerDemographicMetadata
        
        'Metadata classes are not meant to be instantiated.
        Private Sub New()
            MyBase.New
        End Sub
        
        Public Property CustomerDesc As String
        
        Public Property Customers As EntityCollection(Of Customer)
        
        Public Property CustomerTypeID As String
    End Class
End Class

'The MetadataTypeAttribute identifies EmployeeMetadata as the class
' that carries additional metadata for the Employee class.
<MetadataTypeAttribute(GetType(Employee.EmployeeMetadata))>  _
Partial Public Class Employee
    
    'This class allows you to attach custom attributes to properties
    ' of the Employee class.
    '
    'For example, the following marks the Xyz property as a
    ' required property and specifies the format for valid values:
    '    <Required()>
    '    <RegularExpression("[A-Z][A-Za-z0-9]*")>
    '    <StringLength(32)>
    '    Public Property Xyz As String
    Friend NotInheritable Class EmployeeMetadata
        
        'Metadata classes are not meant to be instantiated.
        Private Sub New()
            MyBase.New
        End Sub
        
        Public Property Address As String
        
        Public Property BirthDate As Nullable(Of DateTime)
        
        Public Property City As String
        
        Public Property Country As String
        
        Public Property Employee1 As Employee
        
        Public Property EmployeeID As Integer
        
        Public Property Employees1 As EntityCollection(Of Employee)
        
        Public Property Extension As String
        
        Public Property FirstName As String
        
        Public Property HireDate As Nullable(Of DateTime)
        
        Public Property HomePhone As String
        
        Public Property LastName As String
        
        Public Property Notes As String
        
        Public Property Orders As EntityCollection(Of Order)
        
        Public Property Photo() As Byte
        
        Public Property PhotoPath As String
        
        Public Property PostalCode As String
        
        Public Property Region As String
        
        Public Property ReportsTo As Nullable(Of Integer)
        
        Public Property Territories As EntityCollection(Of Territory)
        
        Public Property Title As String
        
        Public Property TitleOfCourtesy As String
    End Class
End Class

'The MetadataTypeAttribute identifies OrderMetadata as the class
' that carries additional metadata for the Order class.
<MetadataTypeAttribute(GetType(Order.OrderMetadata))>  _
Partial Public Class Order
    
    'This class allows you to attach custom attributes to properties
    ' of the Order class.
    '
    'For example, the following marks the Xyz property as a
    ' required property and specifies the format for valid values:
    '    <Required()>
    '    <RegularExpression("[A-Z][A-Za-z0-9]*")>
    '    <StringLength(32)>
    '    Public Property Xyz As String
    Friend NotInheritable Class OrderMetadata
        
        'Metadata classes are not meant to be instantiated.
        Private Sub New()
            MyBase.New
        End Sub
        
        <Include()>
        Public Property Customer As Customer
        
        Public Property CustomerID As String
        
        Public Property Employee As Employee
        
        Public Property EmployeeID As Nullable(Of Integer)
        
        Public Property Freight As Nullable(Of Decimal)
        
        Public Property Order_Details As EntityCollection(Of Order_Detail)
        
        Public Property OrderDate As Nullable(Of DateTime)
        
        Public Property OrderID As Integer
        
        Public Property RequiredDate As Nullable(Of DateTime)
        
        Public Property ShipAddress As String
        
        Public Property ShipCity As String
        
        Public Property ShipCountry As String
        
        Public Property ShipName As String
        
        Public Property ShippedDate As Nullable(Of DateTime)
        
        Public Property Shipper As Shipper
        
        Public Property ShipPostalCode As String
        
        Public Property ShipRegion As String
        
        Public Property ShipVia As Nullable(Of Integer)
    End Class
End Class

'The MetadataTypeAttribute identifies Order_DetailMetadata as the class
' that carries additional metadata for the Order_Detail class.
<MetadataTypeAttribute(GetType(Order_Detail.Order_DetailMetadata))>  _
Partial Public Class Order_Detail
    
    'This class allows you to attach custom attributes to properties
    ' of the Order_Detail class.
    '
    'For example, the following marks the Xyz property as a
    ' required property and specifies the format for valid values:
    '    <Required()>
    '    <RegularExpression("[A-Z][A-Za-z0-9]*")>
    '    <StringLength(32)>
    '    Public Property Xyz As String
    Friend NotInheritable Class Order_DetailMetadata
        
        'Metadata classes are not meant to be instantiated.
        Private Sub New()
            MyBase.New
        End Sub
        
        Public Property Discount As Single
        
        Public Property Order As Order
        
        Public Property OrderID As Integer
        
        Public Property Product As Product
        
        Public Property ProductID As Integer
        
        Public Property Quantity As Short
        
        Public Property UnitPrice As Decimal
    End Class
End Class

'The MetadataTypeAttribute identifies ProductMetadata as the class
' that carries additional metadata for the Product class.
<MetadataTypeAttribute(GetType(Product.ProductMetadata))>  _
Partial Public Class Product
    
    'This class allows you to attach custom attributes to properties
    ' of the Product class.
    '
    'For example, the following marks the Xyz property as a
    ' required property and specifies the format for valid values:
    '    <Required()>
    '    <RegularExpression("[A-Z][A-Za-z0-9]*")>
    '    <StringLength(32)>
    '    Public Property Xyz As String
    Friend NotInheritable Class ProductMetadata
        
        'Metadata classes are not meant to be instantiated.
        Private Sub New()
            MyBase.New
        End Sub
        
        <Include()>
        Public Property Category As Category
        
        Public Property CategoryID As Nullable(Of Integer)
        
        Public Property Discontinued As Boolean
        
        Public Property Order_Details As EntityCollection(Of Order_Detail)
        
        Public Property ProductID As Integer
        
        Public Property ProductName As String
        
        Public Property QuantityPerUnit As String
        
        Public Property ReorderLevel As Nullable(Of Short)
        
        Public Property Supplier As Supplier
        
        Public Property SupplierID As Nullable(Of Integer)
        
        Public Property UnitPrice As Nullable(Of Decimal)
        
        Public Property UnitsInStock As Nullable(Of Short)
        
        Public Property UnitsOnOrder As Nullable(Of Short)
    End Class
End Class

'The MetadataTypeAttribute identifies RegionMetadata as the class
' that carries additional metadata for the Region class.
<MetadataTypeAttribute(GetType(Region.RegionMetadata))>  _
Partial Public Class Region
    
    'This class allows you to attach custom attributes to properties
    ' of the Region class.
    '
    'For example, the following marks the Xyz property as a
    ' required property and specifies the format for valid values:
    '    <Required()>
    '    <RegularExpression("[A-Z][A-Za-z0-9]*")>
    '    <StringLength(32)>
    '    Public Property Xyz As String
    Friend NotInheritable Class RegionMetadata
        
        'Metadata classes are not meant to be instantiated.
        Private Sub New()
            MyBase.New
        End Sub
        
        Public Property RegionDescription As String
        
        Public Property RegionID As Integer
        
        Public Property Territories As EntityCollection(Of Territory)
    End Class
End Class

'The MetadataTypeAttribute identifies ShipperMetadata as the class
' that carries additional metadata for the Shipper class.
<MetadataTypeAttribute(GetType(Shipper.ShipperMetadata))>  _
Partial Public Class Shipper
    
    'This class allows you to attach custom attributes to properties
    ' of the Shipper class.
    '
    'For example, the following marks the Xyz property as a
    ' required property and specifies the format for valid values:
    '    <Required()>
    '    <RegularExpression("[A-Z][A-Za-z0-9]*")>
    '    <StringLength(32)>
    '    Public Property Xyz As String
    Friend NotInheritable Class ShipperMetadata
        
        'Metadata classes are not meant to be instantiated.
        Private Sub New()
            MyBase.New
        End Sub
        
        Public Property CompanyName As String
        
        Public Property Orders As EntityCollection(Of Order)
        
        Public Property Phone As String
        
        Public Property ShipperID As Integer
    End Class
End Class

'The MetadataTypeAttribute identifies SupplierMetadata as the class
' that carries additional metadata for the Supplier class.
<MetadataTypeAttribute(GetType(Supplier.SupplierMetadata))>  _
Partial Public Class Supplier
    
    'This class allows you to attach custom attributes to properties
    ' of the Supplier class.
    '
    'For example, the following marks the Xyz property as a
    ' required property and specifies the format for valid values:
    '    <Required()>
    '    <RegularExpression("[A-Z][A-Za-z0-9]*")>
    '    <StringLength(32)>
    '    Public Property Xyz As String
    Friend NotInheritable Class SupplierMetadata
        
        'Metadata classes are not meant to be instantiated.
        Private Sub New()
            MyBase.New
        End Sub
        
        Public Property Address As String
        
        Public Property City As String
        
        Public Property CompanyName As String
        
        Public Property ContactName As String
        
        Public Property ContactTitle As String
        
        Public Property Country As String
        
        Public Property Fax As String
        
        Public Property HomePage As String
        
        Public Property Phone As String
        
        Public Property PostalCode As String
        
        Public Property Products As EntityCollection(Of Product)
        
        Public Property Region As String
        
        Public Property SupplierID As Integer
    End Class
End Class

'The MetadataTypeAttribute identifies TerritoryMetadata as the class
' that carries additional metadata for the Territory class.
<MetadataTypeAttribute(GetType(Territory.TerritoryMetadata))>  _
Partial Public Class Territory
    
    'This class allows you to attach custom attributes to properties
    ' of the Territory class.
    '
    'For example, the following marks the Xyz property as a
    ' required property and specifies the format for valid values:
    '    <Required()>
    '    <RegularExpression("[A-Z][A-Za-z0-9]*")>
    '    <StringLength(32)>
    '    Public Property Xyz As String
    Friend NotInheritable Class TerritoryMetadata
        
        'Metadata classes are not meant to be instantiated.
        Private Sub New()
            MyBase.New
        End Sub
        
        Public Property Employees As EntityCollection(Of Employee)
        
        Public Property Region As Region
        
        Public Property RegionID As Integer
        
        Public Property TerritoryDescription As String
        
        Public Property TerritoryID As String
    End Class
End Class

