From cb0e920d83bc72c026c26822d64cf713198958ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sun, 23 Aug 2020 21:55:12 +0300 Subject: [PATCH] Get user list as an example. --- .../Pages/Index.razor | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor index 933d662a15..46308cfa29 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor @@ -1,12 +1,28 @@ @page "/" @using Volo.Abp.Identity @inject IProfileAppService ProfileAppService +@inject IIdentityUserAppService UserAppService -

Remote Service Test

+

Profile Application Service Test

Current user name: @_userName

- + + +

User Application Service Test

+ + + +@if (_users != null) +{ + +

Total user count: @_totalUserCount

+} @code { @@ -18,4 +34,14 @@ _userName = (await ProfileAppService.GetAsync()).UserName; } -} \ No newline at end of file + + private long _totalUserCount = 0; + private IReadOnlyList _users; + + private async Task GetUsersAsync() + { + var result = await UserAppService.GetListAsync(new GetIdentityUsersInput()); + _totalUserCount = result.TotalCount; + _users = result.Items; + } +}