Imports System.Runtime.Serialization

Namespace Messages
    <Serializable>
    <DataContract>
    <KnownType(GetType(DBNull))>
    Public MustInherit Class BaseResponse
        <DataMember>
        Public Property OK As Boolean
        <DataMember>
        Public Property ErrorMessage As String
        <DataMember>
        Public Property ErrorDetails 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

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


