Imports System.Runtime.Serialization

Namespace Messages
    <Serializable>
    <DataContract>
    <KnownType(GetType(DBNull))>
    Public MustInherit Class BaseResult
        <DataMember>
        Public Property OK As Boolean
        <DataMember>
        Public Property ErrorMessage As String

        Public Sub New()
            OK = True
        End Sub

        Public Sub New(Message As String)
            OK = False
            ErrorMessage = Message
        End Sub

        Public Sub New(Exception As Exception)
            OK = False
            ErrorMessage = Exception.Message
        End Sub
    End Class
End Namespace


