Class NotFoundError
Represents a "not found" error (HTTP 404 equivalent). Use when a requested resource does not exist.
public class NotFoundError : Reason<NotFoundError>, IError, IReason
- Inheritance
-
NotFoundError
- Implements
- Inherited Members
- Extension Methods
Examples
Result<User>.Fail(new NotFoundError("User", userId));
Result<Order>.Fail(new NotFoundError("Order not found"));
Constructors
NotFoundError(string)
public NotFoundError(string message)
Parameters
messagestring
NotFoundError(string, object)
public NotFoundError(string entityName, object id)
Parameters
Methods
CreateNew(string, ImmutableDictionary<string, object>)
Factory method for creating new instances (maintains immutability). Must be implemented by derived classes.
protected override NotFoundError CreateNew(string message, ImmutableDictionary<string, object> tags)
Parameters
messagestringtagsImmutableDictionary<string, object>