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
originalModelGraphValidationRequest
ModelGraphValidationRequest(object, IServiceProvider?, string)
Represents a request to validate an object graph with IModelGraphValidator.
public ModelGraphValidationRequest(object Instance, IServiceProvider? ServiceProvider = null, string RootPath = "")
Parameters
InstanceobjectThe root of the object graph to validate.
ServiceProviderIServiceProviderThe 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.
RootPathstringThe member path that
Instancesits 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
Instance
The root of the object graph to validate.
public object Instance { get; init; }
Property Value
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
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
Methods
Deconstruct(out object, out IServiceProvider?, out string)
public void Deconstruct(out object Instance, out IServiceProvider? ServiceProvider, out string RootPath)
Parameters
InstanceobjectServiceProviderIServiceProviderRootPathstring
Equals(ModelGraphValidationRequest?)
public virtual bool Equals(ModelGraphValidationRequest? other)
Parameters
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(ModelGraphValidationRequest?, ModelGraphValidationRequest?)
public static bool operator ==(ModelGraphValidationRequest? left, ModelGraphValidationRequest? right)
Parameters
Returns
operator !=(ModelGraphValidationRequest?, ModelGraphValidationRequest?)
public static bool operator !=(ModelGraphValidationRequest? left, ModelGraphValidationRequest? right)