﻿using System;
using System.Runtime.Serialization;

namespace Demo.Data
{
    /// <summary>
    /// The exception that is thrown when an expected definition of a data access object is not found, or is not unique.
    /// </summary>
    [Serializable]
    public class DataAccessObjectNotFoundException : Exception
    {
        /// <summary>
        /// Class base consturctor.
        /// </summary>
        public DataAccessObjectNotFoundException() : base() { }

        /// <summary>
        /// Initializes a new instance of this class with a specified error message.
        /// </summary>
        /// <param name="message">The message that describes the exception.</param>
        public DataAccessObjectNotFoundException(string message) : base(message) { }

        /// <summary>
        /// Initializes a new instance of this class with serialized data.
        /// </summary>
        /// <param name="info">
        /// The SerializationInfo that holds the serialized object data about the exception being thrown. 
        /// </param>
        /// <param name="context">
        /// The StreamingContext that contains contextual information about the source or destination.
        /// </param>
        protected DataAccessObjectNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { }

        /// <summary>
        /// Initializes a new instance of this class with a specified error message 
        /// and a reference to the inner exception that is the cause of this exception.
        /// </summary>
        /// <param name="message">The message that describes the exception.</param>
        /// <param name="innerException">
        /// The exception that is the cause of the current exception, or a null reference if no inner exception is specified. 
        /// </param>
        public DataAccessObjectNotFoundException(string message, Exception innerException) : base(message, innerException) { }
    }
}
