Пример #1
0
        public async Task <IActionResult> Index()
        {
            var clients = await _clientControlService.ListAllClientsAsync();

            var vm = clients.Select(x => new ClientViewModel(x));

            return(View(vm));
        }
Пример #2
0
        public async Task <IActionResult> Index(string document)
        {
            var clients = !string.IsNullOrEmpty(document) ? await _clientControlService.GetClientByDocumentAsync(document)
                                                          : await _clientControlService.ListAllClientsAsync();

            var vm = clients.Select(x => new ClientViewModel(x));

            return(View(vm));
        }