You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.3 KiB
38 lines
1.3 KiB
using System;
|
|
using System.Threading.Tasks;
|
|
using Volo.Abp.DependencyInjection;
|
|
using Volo.Abp.Identity;
|
|
using Volo.Abp.Account;
|
|
|
|
namespace BookStore.HttpApi.Client.ConsoleTestApp;
|
|
|
|
public class ClientDemoService : ITransientDependency
|
|
{
|
|
private readonly IProfileAppService _profileAppService;
|
|
private readonly IIdentityUserAppService _identityUserAppService;
|
|
|
|
public ClientDemoService(
|
|
IProfileAppService profileAppService,
|
|
IIdentityUserAppService identityUserAppService)
|
|
{
|
|
_profileAppService = profileAppService;
|
|
_identityUserAppService = identityUserAppService;
|
|
}
|
|
|
|
public async Task RunAsync()
|
|
{
|
|
var profileDto = await _profileAppService.GetAsync();
|
|
Console.WriteLine($"UserName : {profileDto.UserName}");
|
|
Console.WriteLine($"Email : {profileDto.Email}");
|
|
Console.WriteLine($"Name : {profileDto.Name}");
|
|
Console.WriteLine($"Surname : {profileDto.Surname}");
|
|
Console.WriteLine();
|
|
|
|
var resultDto = await _identityUserAppService.GetListAsync(new GetIdentityUsersInput());
|
|
Console.WriteLine($"Total users: {resultDto.TotalCount}");
|
|
foreach (var identityUserDto in resultDto.Items)
|
|
{
|
|
Console.WriteLine($"- [{identityUserDto.Id}] {identityUserDto.Name}");
|
|
}
|
|
}
|
|
}
|
|
|