示例#1
0
        public async Task <IEnumerable <Tenant> > Get()
        {
            var tenantsDto = await _tenantsRepository.Get();

            var tenants = _mapper.Map <IEnumerable <Tenant> >(tenantsDto);

            return(tenants);
        }
示例#2
0
        public async Task <TenantVm> Handle(GetTenantQuery request, CancellationToken cancellationToken)
        {
            var tenantsDto = await _tenantsRepository.Get(request.Id);

            var tenant   = _mapper.Map <Tenant>(tenantsDto);
            var tenantVm = _mapper.Map <TenantVm>(tenant);

            return(tenantVm);
        }
        public async Task <TenantsVm> Handle(GetTenantsQuery request, CancellationToken cancellationToken)
        {
            var tenantsDto = await _tenantsRepository.Get();

            var tenants   = _mapper.Map <IEnumerable <Tenant> >(tenantsDto);
            var tenantsVm = new TenantsVm
            {
                Tenants = _mapper.Map <IEnumerable <TenantVm> >(tenants)
            };

            return(tenantsVm);
        }