Table of Contents

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

CorrelationId

Data

The data returned.

public object Data { get; set; }

Property Value

object

ExceptionMessages

Gets any exception messages that might have occurred.

public IEnumerable<string> ExceptionMessages { get; set; }

Property Value

IEnumerable<string>

ExceptionStackTrace

Gets the stack trace if there was an exception.

public string ExceptionStackTrace { get; set; }

Property Value

string

HasExceptions

Gets whether there are any exceptions that occurred.

public bool HasExceptions { get; }

Property Value

bool

IsAuthorized

Gets whether the query was authorized to execute.

public bool IsAuthorized { get; set; }

Property Value

bool

IsSuccess

Gets whether or not the query executed successfully.

public bool IsSuccess { get; }

Property Value

bool

IsValid

Gets whether the query is valid.

public bool IsValid { get; }

Property Value

bool

Paging

Gets or inits the PagingInfo for the query.

public PagingInfo Paging { get; set; }

Property Value

PagingInfo

ValidationResults

Gets the validation results for the query.

public IEnumerable<ValidationResult> ValidationResults { get; set; }

Property Value

IEnumerable<ValidationResult>

Methods

Error(CorrelationId, Exception)

Creates a new QueryResult representing an error.

public static QueryResult Error(CorrelationId correlationId, Exception exception)

Parameters

correlationId CorrelationId

The CorrelationId associated with the query.

exception Exception

The exception.

Returns

QueryResult

A QueryResult.

Error(CorrelationId, string)

Creates a new QueryResult representing an error.

public static QueryResult Error(CorrelationId correlationId, string message)

Parameters

correlationId CorrelationId

The CorrelationId associated with the query.

message string

The error message.

Returns

QueryResult

A QueryResult.

MergeWith(params QueryResult[])

Merges the results of one or more QueryResult instances into this.

public void MergeWith(params QueryResult[] queryResults)

Parameters

queryResults QueryResult[]

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

correlationId CorrelationId

The CorrelationId associated with the query.

name FullyQualifiedQueryName

The name of the query that is missing a performer.

Returns

QueryResult

A QueryResult.

Success(CorrelationId)

Represents a successful command result.

public static QueryResult Success(CorrelationId correlationId)

Parameters

correlationId CorrelationId

The 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

correlationId CorrelationId

The CorrelationId associated with the query.

Returns

QueryResult

A QueryResult.