Class EntityNotFoundException
An exception used to indicate that an Umbraco entity could not be found.
Inheritance
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 SourceEntityNotFoundException()
Initializes a new instance of the EntityNotFoundException class.
Declaration
public EntityNotFoundException()
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. |
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. |
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. |
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 SourceId
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 SourceGetObjectData(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 |
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. |