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