Skip to content

Instantly share code, notes, and snippets.

@ByteDev
Last active August 12, 2021 03:25
Show Gist options
  • Save ByteDev/b40b378609a0f86df08763fd11278a36 to your computer and use it in GitHub Desktop.
Save ByteDev/b40b378609a0f86df08763fd11278a36 to your computer and use it in GitHub Desktop.
using System;
using System.Runtime.Serialization;

// ...

[Serializable]
public class EntityNotFoundException : Exception
{
    private const string DefaultMessage = "Entity does not exist.";

    public EntityNotFoundException() : base(DefaultMessage)
    {
    }

    public EntityNotFoundException(string message) : base(message)
    {
    }

    public EntityNotFoundException(string message, Exception innerException) : base(message, innerException)
    {
    }

    protected EntityNotFoundException(SerializationInfo info, StreamingContext context)
        : base(info, context)
    {
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment