工具生成版本
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
using Volo.Abp.Identity;
|
||||
using Volo.Abp.Account;
|
||||
|
||||
namespace Hua.Abp.Demo.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}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user