Namespace REslava.Result
Classes
- AsyncPredicateValidatorRule<T, TProperty>
A validation rule that uses an async predicate function to validate a property of an entity. Supports async lambda expressions for asynchronous validation scenarios.
- ConflictError
Represents a conflict error (HTTP 409 equivalent). Use when an operation conflicts with existing state (duplicates, version conflicts).
- ConversionError
Represents an error that occurred during implicit type conversion. This error is used when implicit operators receive invalid input (null, empty collections, etc.) instead of throwing exceptions, keeping the API consistent with the Result pattern philosophy.
- ExceptionError
Wraps a .NET Exception as a typed error reason. Automatically captures the exception type, stack trace, and inner exception message as tags. Produced automatically by Try(Action, Func<Exception, IError>?) and TryAsync(Func<Task>, Func<Exception, IError>?, CancellationToken).
- ForbiddenError
Represents an authorization error (HTTP 403 equivalent). Use when the caller is authenticated but lacks permission.
- NotFoundError
Represents a "not found" error (HTTP 404 equivalent). Use when a requested resource does not exist.
- PredicateValidatorRule<T, TProperty>
A validation rule that uses a predicate function to validate a property of an entity. Supports lambda expressions for concise rule definitions.
- Reason
Abstract base class for all result reasons (errors and successes). Provides immutable Message and Tags storage with a consistent ToString() representation.
- Result
Factory methods for non-generic Result.
- ResultMatchExtensions
Extension methods for match operations on Result types.
- Result<TValue>
Represents the result of an operation with a value of type TValue. Immutable by design - all operations return new instances.
- TagAccessExtensions
Extension methods for safe tag access on Reason and Error types.
- UnauthorizedError
Represents an authentication error (HTTP 401 equivalent). Use when the caller is not authenticated or credentials are invalid.
- ValidationError
Represents a validation error (HTTP 400/422 equivalent). Use when input data fails validation rules.
- ValidationExtensions
Provides consistent validation extension methods with standardized error messages. All methods throw ArgumentException (or ArgumentNullException) with consistent formatting. Use these to validate inputs and maintain consistent error messages across the library.
- ValidationResult<T>
Represents the result of a validation operation with a value of type T. Inherits from Result<T> and provides validation-specific convenience methods.
- ValidatorRuleBuilderExtensions
Extension methods on ValidatorRuleBuilder<T> providing a native DSL for common validation rules (string, numeric, collection, null checks).
- ValidatorRuleBuilder<T>
Fluent builder for creating validation rule sets for a specific entity type. Provides a fluent API for defining validation rules with method chaining.
- ValidatorRuleSet<T>
Immutable collection of validation rules for a specific entity type. Provides methods to validate entities against all rules in the set.
Interfaces
- IError
Marker interface for error reasons. Implement or extend to create custom error types that integrate with Result<TValue> failure semantics and HTTP status mapping.
- IReason
Base contract for all result reasons — errors, successes, and custom outcomes. All reasons carry a human-readable message and an optional metadata dictionary.
- IResultBase
Non-generic contract for a result — exposes status flags and reason lists without requiring knowledge of the success value type. Useful for middleware, logging pipelines, and generic result-handling utilities.
- IResultBase<TValue>
Generic contract for a typed result — extends IResultBase with access to the successful value.
- ISuccess
Marker interface for success reasons. Implement to attach structured metadata to a successful result without changing its value.