public override async Task ExecuteAsync(Context context, TextWriter writer) { var classlist = await CourseEndpoint.GetClasslist(context, CourseId); foreach (var user in classlist) { writer.WriteLine(user); } }
public override async Task ExecuteAsync(Context context, TextWriter writer) { var result = await CourseEndpoint.GetAll(context); foreach (var item in result.Items) { foreach (var orgUnit in item.OrgUnit) { writer.WriteLine($"* [{orgUnit.Type.Name}] {orgUnit.Code} ({orgUnit.Id}) - {orgUnit.Name}"); } } }
public override async Task ExecuteAsync(Context context, TextWriter writer) { var user = await CourseEndpoint.FindUserByUsername(context, CourseId, Username); if (user == null) { writer.WriteLine("User not found."); } else if (IdOnly) { writer.WriteLine(user.Identifier); } else { writer.WriteLine(user); } }