コード例 #1
0
        protected override async Task ExecuteAsync(IConsole console)
        {
            var users = await ServerAccessor.ListUsersAsync();

            if (users.Count == 0)
            {
                await WarnLineAsync("No users found");
            }

            int idLenght = users.Max(x => x.Id.ToString().Length) + 2;

            await InfoLineAsync($"Id{Space(idLenght)}Name");

            foreach (var user in users)
            {
                await WriteLineAsync($"{user.Id}    {user.Name}");
            }
        }