Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Execute query.

Description

Excecutes a query to filter out by place of supply or status.

Package Details

Interface

IServiceRequestManager

Syntax
Task<ICollection<ServiceRequest>> ExecuteQuery<T>(ServiceRequestQuery serviceRequestQuery)

Returns

Task<ICollection<ServiceRequest>>

API

[POST] /api/servicerequests/query

[API JSON Structure]

Returns

Collection of service requests

Example - Filtering by place of supply and status

//This is an exemple of a query using filtering for the place of supply and status.
//This will filter all service requests for service id 11.
const ServiceRequestStatus status = ServiceRequestStatus.InProgress;
const string province = "ON";
var query = new ServiceRequestQuery
{
    ServiceId = ServiceId,
    Page = 1,
    PageSize = 25,
    Version = 1.0F,
    Filter = $"PlaceOfSupply='{province}' AND Status='{status}'"
};
            
// Get all service requests with metadata using the place of supply and status filter.
var requestWithMetadata = await serviceRequestManager.ExecuteQuery<ServiceRequestMetadata>(query, false);

// Get all service requests without metadata using the place of supply and status filter.
var requestsNoMetadata = await serviceRequestManager.ExecuteQuery<NoMetadata>(query, true);

Example - Filtering by place of supply only

//This is an exemple of a query using filtering for the place of supply and status.
//This will filter all service requests for service id 11.
const string province = "ON";
var query = new ServiceRequestQuery
{
    ServiceId = ServiceId,
    Page = 1,
    PageSize = 25,
    Version = 1.0F,
    Filter = $"PlaceOfSupply='{province}'"
};
            
// Get all service requests with metadata using the place of supply and status filter.
var requestWithMetadata = await serviceRequestManager.ExecuteQuery<ServiceRequestMetadata>(query, false);

// Get all service requests without metadata using the place of supply and status filter.
var requestsNoMetadata = await serviceRequestManager.ExecuteQuery<NoMetadata>(query, true);

Example - Filtering by service request status

//This is an exemple of a query using filtering for the place of supply and status.
//This will filter all service requests for service id 11.
const ServiceRequestStatus status = ServiceRequestStatus.InProgress;
var query = new ServiceRequestQuery
{
    ServiceId = ServiceId,
    Page = 1,
    PageSize = 25,
    Version = 1.0F,
    Filter = $"Status='{status}'"
};
            
// Get all service requests with metadata using the place of supply and status filter.
var requestWithMetadata = await serviceRequestManager.ExecuteQuery<ServiceRequestMetadata>(query, false);

// Get all service requests without metadata using the place of supply and status filter.
var requestsNoMetadata = await serviceRequestManager.ExecuteQuery<NoMetadata>(query, true);

  • No labels