Class QueryResult
- Namespace
- Cratis.Applications.Queries
- Assembly
- Cratis.Applications.dll
Represents the result coming from performing a query.
public class QueryResult
- Inheritance
-
QueryResult
- Inherited Members
- Extension Methods
Properties
CorrelationId
Gets the CorrelationId associated with the command.
public CorrelationId CorrelationId { get; set; }
Property Value
Data
The data returned.
public object Data { get; set; }
Property Value
ExceptionMessages
Gets any exception messages that might have occurred.
public IEnumerable<string> ExceptionMessages { get; set; }
Property Value
ExceptionStackTrace
Gets the stack trace if there was an exception.
public string ExceptionStackTrace { get; set; }
Property Value
HasExceptions
Gets whether there are any exceptions that occurred.
public bool HasExceptions { get; }
Property Value
IsAuthorized
Gets whether the query was authorized to execute.
public bool IsAuthorized { get; set; }
Property Value
IsSuccess
Gets whether or not the query executed successfully.
public bool IsSuccess { get; }
Property Value
IsValid
Gets whether the query is valid.
public bool IsValid { get; }
Property Value
Paging
Gets or inits the PagingInfo for the query.
public PagingInfo Paging { get; set; }
Property Value
ValidationResults
Gets the validation results for the query.
public IEnumerable<ValidationResult> ValidationResults { get; set; }
Property Value
Methods
Error(CorrelationId, Exception)
Creates a new QueryResult representing an error.
public static QueryResult Error(CorrelationId correlationId, Exception exception)
Parameters
correlationIdCorrelationIdThe CorrelationId associated with the query.
exceptionExceptionThe exception.
Returns
Error(CorrelationId, string)
Creates a new QueryResult representing an error.
public static QueryResult Error(CorrelationId correlationId, string message)
Parameters
correlationIdCorrelationIdThe CorrelationId associated with the query.
messagestringThe error message.
Returns
MergeWith(params QueryResult[])
Merges the results of one or more QueryResult instances into this.
public void MergeWith(params QueryResult[] queryResults)
Parameters
queryResultsQueryResult[]Params of QueryResult to merge with.
MissingPerformer(CorrelationId, FullyQualifiedQueryName)
Creates a new QueryResult representing a missing performer.
public static QueryResult MissingPerformer(CorrelationId correlationId, FullyQualifiedQueryName name)
Parameters
correlationIdCorrelationIdThe CorrelationId associated with the query.
nameFullyQualifiedQueryNameThe name of the query that is missing a performer.
Returns
Success(CorrelationId)
Represents a successful command result.
public static QueryResult Success(CorrelationId correlationId)
Parameters
correlationIdCorrelationIdThe correlation ID.
Returns
- QueryResult
A successful QueryResult.
Unauthorized(CorrelationId)
Creates a new QueryResult representing an unauthorized query execution.
public static QueryResult Unauthorized(CorrelationId correlationId)
Parameters
correlationIdCorrelationIdThe CorrelationId associated with the query.