...
IAccountManager
Syntax
Code Block |
---|
_accountManagerAccountManager.GetEnrollments(int userId, bool activeUser = true); AccountManager.GetEnrollments(int userId, int [_serviceId, bool activeUser = true_]); _accountManagerAccountManager.GetEnrollments(int userId, int serviceId [_, int organizationId, bool activeUser = true); AccountManager.GetEnrollments(int userId, bool activeUser = true); AccountManager.GetEnrollments(int userId, int serviceId, bool activeUser = true_]); _accountManagerAccountManager.GetEnrollments(int userId, int serviceId, int organizationId [_, bool activeUser = true_]); |
Returns
ICollection<EnrollmentInfo>
Task<ICollection<EnrollmentInfo>>
API
[GET] /api/v1/account/enrollments
Parameters
Parameter | Description | Parameter Type |
---|---|---|
userId: [Integer] | User id | query string |
serviceId: [Integer] | Service id | query string |
organizationId: [Integer] | Organization id | query string |
activeUser: [Boolean] | If true get all active users, if false get all active and inactive users | query string |
Returns
EnrollmentInfo object that contains information about the user enrollments.
Example
Code Block | |||
---|---|---|---|
|
| ||
var enrollments = await _accountManager.GetEnrollments(userId, serviceId);
if (enrollments.Count == 0)
{
return false;
}
var enrollment = enrollments.Select(x => x).FirstOrDefault();
if (enrollment == null)
{
return false;
}
|