GetByServiceId() [ServiceRequestManager]
Retrieve a list of service requests filtered by service id
Description
This method is used to retrieve a list of service requests that are filtered by service ID. Overrides include the ability to further filter by organization ID, page number, and page size.
Package Details
Interface
IServiceRequestManager
Syntax
ServiceRequestManager.GetByServiceId<T>(int serviceId) where T : IServiceRequestMetadata
ServiceRequestManager.GetByServiceId<T>(int serviceId, int organizationId) where T : IServiceRequestMetadata
ServiceRequestManager.GetByServiceId<T>(int serviceId, int page, int pageSize) where T : IServiceRequestMetadata
ServiceRequestManager.GetByServiceId<T>(int serviceId, int organizationId, int page, int pageSize) where T : IServiceRequestMetadata;
Returns
ICollection<MTOA.DomainObjects.ServiceRequest>
API Endpoint
[GET] /api/v1/users/{id}/servicerequests
Returns
200 - Ok
Example
using MTOA.BLL.Interfaces;
int myServiceId = 123;
int myOrganizationId = 567;
int pageNumber = 1;
int pageSize = 20;
var serviceRequests = await _serviceRequestManager.Get<ServiceRequest>(myServiceId, myOrganizationId, pageNumber, pageSize);