Ejemplo n.º 1
0
        public async Task GetListAsync()
        {
            var result = await _tenantAppService.GetListAsync(new GetTenantsInput()).ConfigureAwait(false);

            result.TotalCount.ShouldBeGreaterThan(0);
            result.Items.ShouldContain(t => t.Name == "acme");
            result.Items.ShouldContain(t => t.Name == "volosoft");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 演示如何使用应用程序服务接口(ITenantAppService)来调用远程服务,动态http客户端代理系统可以使用远程服务。
        /// <para>不需要使用IIdentityModelAuthenticationService,因为动态http客户端代理系统在内部使用它。您只需注入一个服务(ITenantAppService)并像调用本地方法一样调用一个方法(GetListAsync)。</para>
        /// </summary>
        private async Task TestTenantManagementService()
        {
            Console.WriteLine();
            Console.WriteLine("*** TestTenantManagementService ************************************");

            try
            {
                var output = await _tenantAppService.GetListAsync(new GetTenantsInput());

                Console.WriteLine("Total tenant count: " + output.TotalCount);

                foreach (var tenant in output.Items)
                {
                    Console.WriteLine($"- Id={tenant.Id}, Name={tenant.Name}");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Ejemplo n.º 3
0
 public Task <PagedResultDto <TenantDto> > GetListAsync(GetTenantsInput input)
 {
     return(_service.GetListAsync(input));
 }
Ejemplo n.º 4
0
 public async Task <PagedResultDto <TenantDto> > GetListAsync(GetTenantInput input)
 {
     return(await _tenantAppService.GetListAsync(input));
 }
Ejemplo n.º 5
0
        public async Task <PagedResult <TenantDto> > GetListAsync(GetTenantsInput input)
        {
            var result = await _tenantAppService.GetListAsync(input);

            return(new PagedResult <TenantDto>(result.TotalCount, result.Items));
        }
        public async Task <ServiceResponse <List <TenantModel> > > GetListAsync()
        {
            var res = await _tenantAppService.GetListAsync();

            return(ServiceResponse <List <TenantModel> > .Success(res));
        }