Class ModelGraphValidationRequest

Namespace
Cratis.Arc.Validation
Assembly
Cratis.Arc.Core.dll

Represents a request to validate an object graph with IModelGraphValidator.

public record ModelGraphValidationRequest : IEquatable<ModelGraphValidationRequest>
Inheritance
ModelGraphValidationRequest
Implements
Inherited Members
Extension Methods

Constructors

ModelGraphValidationRequest(ModelGraphValidationRequest)

protected ModelGraphValidationRequest(ModelGraphValidationRequest original)

Parameters

original ModelGraphValidationRequest

ModelGraphValidationRequest(object, IServiceProvider?, string)

Represents a request to validate an object graph with IModelGraphValidator.

public ModelGraphValidationRequest(object Instance, IServiceProvider? ServiceProvider = null, string RootPath = "")

Parameters

Instance object

The root of the object graph to validate.

ServiceProvider IServiceProvider

The IServiceProvider to resolve validators and their dependencies from. When not supplied, the ambient provider is used. Supply the request-scoped provider so a validator sees the same scope as the operation it validates.

RootPath string

The member path that Instance sits at, used to prefix every failure member. Empty for a command, whose properties are already named from the client's perspective; the parameter name for a query argument, so a failure reported by a nested validator is attributable to the argument that carried it.

Properties

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

Instance

The root of the object graph to validate.

public object Instance { get; init; }

Property Value

object

RootPath

The member path that Instance sits at, used to prefix every failure member. Empty for a command, whose properties are already named from the client's perspective; the parameter name for a query argument, so a failure reported by a nested validator is attributable to the argument that carried it.

public string RootPath { get; init; }

Property Value

string

ServiceProvider

The IServiceProvider to resolve validators and their dependencies from. When not supplied, the ambient provider is used. Supply the request-scoped provider so a validator sees the same scope as the operation it validates.

public IServiceProvider? ServiceProvider { get; init; }

Property Value

IServiceProvider

Methods

Deconstruct(out object, out IServiceProvider?, out string)

public void Deconstruct(out object Instance, out IServiceProvider? ServiceProvider, out string RootPath)

Parameters

Instance object
ServiceProvider IServiceProvider
RootPath string

Equals(ModelGraphValidationRequest?)

public virtual bool Equals(ModelGraphValidationRequest? other)

Parameters

other ModelGraphValidationRequest

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(ModelGraphValidationRequest?, ModelGraphValidationRequest?)

public static bool operator ==(ModelGraphValidationRequest? left, ModelGraphValidationRequest? right)

Parameters

left ModelGraphValidationRequest
right ModelGraphValidationRequest

Returns

bool

operator !=(ModelGraphValidationRequest?, ModelGraphValidationRequest?)

public static bool operator !=(ModelGraphValidationRequest? left, ModelGraphValidationRequest? right)

Parameters

left ModelGraphValidationRequest
right ModelGraphValidationRequest

Returns

bool