Imports System
Imports System.Collections.Generic
Imports Model

Public Class ContactException
    Inherits ApplicationException
    Public Sub New(ByVal message As String, ByVal contacts As List(Of Contact))
        MyBase.New(message)
        Me.Contacts = contacts
    End Sub
    Private privateContacts As List(Of Contact)
    Public Property Contacts() As List(Of Contact)
        Get
            Return privateContacts
        End Get
        Set(ByVal value As List(Of Contact))
            privateContacts = value
        End Set
    End Property

    Public ReadOnly Property NameList() As List(Of String)
        Get
            Dim names As List(Of String) = New List(Of String)()
            For Each contact As Contact In Me.Contacts
                names.Add(contact.ContactName)
            Next contact
            Return names
        End Get
    End Property
End Class
