Class QueryArgumentsModels
- Namespace
- Cratis.Arc.Queries
- Assembly
- Cratis.Arc.Core.dll
Represents an implementation of IQueryArgumentsModels that resolves the arguments model by convention.
[Singleton]
public class QueryArgumentsModels : IQueryArgumentsModels
- Inheritance
-
QueryArgumentsModels
- Implements
- Inherited Members
- Extension Methods
Remarks
The model is a type named {QueryName}Parameters or {ReadModelName}{QueryName}Parameters in the read
model's assembly, whose properties cover every parameter of the query. The same convention is what the proxy
generator uses to find the rules it emits into the client, so both sides resolve the same type and validate the
same shape.
Constructors
QueryArgumentsModels(ILogger<QueryArgumentsModels>)
Represents an implementation of IQueryArgumentsModels that resolves the arguments model by convention.
public QueryArgumentsModels(ILogger<QueryArgumentsModels> logger)
Parameters
loggerILogger<QueryArgumentsModels>The ILogger<TCategoryName> used to log a model that cannot be materialized.
Remarks
The model is a type named {QueryName}Parameters or {ReadModelName}{QueryName}Parameters in the read
model's assembly, whose properties cover every parameter of the query. The same convention is what the proxy
generator uses to find the rules it emits into the client, so both sides resolve the same type and validate the
same shape.
Methods
TryCreateFor(IQueryPerformer, QueryArguments, out object)
Tries to materialize the arguments model for a query from the arguments it was called with.
public 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.