Class NotFoundError
Represents a "not found" error (HTTP 404 equivalent). Use when a requested resource does not exist.
public class NotFoundError : Reason<NotFoundError>, IReasonMetadata, IError, IReason, IErrorFactory<NotFoundError>
- 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, object, string?, string?, int)
public NotFoundError(string entityName, object id, string? callerMember = null, string? callerFile = null, int callerLine = 0)
Parameters
NotFoundError(string, string?, string?, int)
public NotFoundError(string message, string? callerMember = null, string? callerFile = null, int callerLine = 0)
Parameters
Methods
Create(string)
Creates an instance of NotFoundError with the given message.
public static NotFoundError Create(string message)
Parameters
messagestring
Returns
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>