Search Results for

    Show / Hide Table of Contents
    View Source

    Class EntityNotFoundException

    An exception used to indicate that an Umbraco entity could not be found.

    Inheritance
    System.Object
    System.Exception
    Namespace: Umbraco.Core.Persistence
    Assembly: Umbraco.Core.dll
    Syntax
    [Obsolete("Instead of throwing an exception, return null or an HTTP 404 status code instead.")]
    [Serializable]
    public class EntityNotFoundException : Exception, ISerializable, _Exception

    Constructors

    View Source

    EntityNotFoundException()

    Initializes a new instance of the EntityNotFoundException class.

    Declaration
    public EntityNotFoundException()
    View Source

    EntityNotFoundException(Object, String)

    Initializes a new instance of the EntityNotFoundException class.

    Declaration
    public EntityNotFoundException(object id, string message)
    Parameters
    Type Name Description
    System.Object id

    The identifier.

    System.String message

    The message.

    View Source

    EntityNotFoundException(SerializationInfo, StreamingContext)

    Initializes a new instance of the EntityNotFoundException class.

    Declaration
    protected EntityNotFoundException(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info

    The System.Runtime.Serialization.SerializationInfo that holds the serialized object data about the exception being thrown.

    System.Runtime.Serialization.StreamingContext context

    The System.Runtime.Serialization.StreamingContext that contains contextual information about the source or destination.

    View Source

    EntityNotFoundException(String)

    Initializes a new instance of the EntityNotFoundException class.

    Declaration
    public EntityNotFoundException(string message)
    Parameters
    Type Name Description
    System.String message

    The message that describes the error.

    View Source

    EntityNotFoundException(String, Exception)

    Initializes a new instance of the EntityNotFoundException class.

    Declaration
    public EntityNotFoundException(string message, Exception innerException)
    Parameters
    Type Name Description
    System.String message

    The error message that explains the reason for the exception.

    System.Exception innerException

    The exception that is the cause of the current exception, or a null reference (langword_csharp_Nothing in Visual Basic) if no inner exception is specified.

    Properties

    View Source

    Id

    Gets the identifier.

    Declaration
    public object Id { get; }
    Property Value
    Type Description
    System.Object

    The identifier.

    Remarks

    This object should be serializable to prevent a System.Runtime.Serialization.SerializationException to be thrown.

    Methods

    View Source

    GetObjectData(SerializationInfo, StreamingContext)

    When overridden in a derived class, sets the System.Runtime.Serialization.SerializationInfo with information about the exception.

    Declaration
    public override void GetObjectData(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info

    The System.Runtime.Serialization.SerializationInfo that holds the serialized object data about the exception being thrown.

    System.Runtime.Serialization.StreamingContext context

    The System.Runtime.Serialization.StreamingContext that contains contextual information about the source or destination.

    Exceptions
    Type Condition
    System.ArgumentNullException

    info

    View Source

    ToString()

    Returns a System.String that represents this instance.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    A System.String that represents this instance.

    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • EntityNotFoundException()
      • EntityNotFoundException(Object, String)
      • EntityNotFoundException(SerializationInfo, StreamingContext)
      • EntityNotFoundException(String)
      • EntityNotFoundException(String, Exception)
    • Properties
      • Id
    • Methods
      • GetObjectData(SerializationInfo, StreamingContext)
      • ToString()
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX