...
IAccountManager
Syntax
Code Block | ||
---|---|---|
| ||
AccountManager.GetEnrollments(int userId [_, bool activeUser = true_]); _accountManagerAccountManager.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;
}
|