Пример #1
0
        public async Task <IActionResult> Manage(ManageOfficesViewModel vm)
        {
            var officeDtos = await officeServices.GetMultipleOfficesByCompanyNameAsync(vm.Input);

            if (officeDtos.Count == 0)
            {
                ModelState.AddModelError(string.Empty, "No offices found with this company name.");

                return(View());
            }

            vm.Offices = mapper.Map <List <OfficeViewModel> >(officeDtos);

            return(View(vm));
        }