Interface IQueryArgumentsModels
- Namespace
- Cratis.Arc.Queries
- Assembly
- Cratis.Arc.Core.dll
Defines a system that materializes the model representing a query's argument set as a whole.
public interface IQueryArgumentsModels
- Extension Methods
Remarks
A query's arguments are flat, and a validator can be declared against that flat shape by declaring a
QueryValidator<T> for a type whose properties mirror the query's parameters. The generated TypeScript
proxy validates its arguments object against exactly that shape, so without a server-side counterpart such a
validator would be enforced in the browser only — which is to say not enforced at all, since anything can call the
endpoint directly. This is that counterpart.
Methods
TryCreateFor(IQueryPerformer, QueryArguments, out object)
Tries to materialize the arguments model for a query from the arguments it was called with.
bool TryCreateFor(IQueryPerformer performer, QueryArguments arguments, out object model)
Parameters
performerIQueryPerformerThe IQueryPerformer for the query.
argumentsQueryArgumentsThe QueryArguments the query was called with.
modelobjectThe materialized model when the query has one.
Returns
- bool
True when the query has an arguments model and it could be materialized; otherwise false.