Class NotFoundError

Namespace
REslava.Result
Assembly
REslava.Result.dll

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

message string

NotFoundError(string, object)

public NotFoundError(string entityName, object id)

Parameters

entityName string
id object

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

message string
tags ImmutableDictionary<string, object>

Returns

NotFoundError