public async Task <IActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            var collaborator = await _collaboratorService.FindByIdAsync(id.Value);

            if (collaborator == null)
            {
                return(NotFound());
            }
            List <Legalperson>        legalpersons  = _legalpersonService.FindAll();
            List <Shippingway>        shippingways  = _shippingwayService.FindAll();
            List <Saleschannel>       saleschannels = _saleschannelService.FindAll();
            List <Plan>               plans         = _planService.FindAll();
            CollaboratorFormViewModel viewModel     = new CollaboratorFormViewModel
            {
                Collaborator  = collaborator,
                Legalpersons  = legalpersons,
                Shippingways  = shippingways,
                Saleschannels = saleschannels,
                Plans         = plans
            };

            return(View(viewModel));
        }
        public async Task <IActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            var physicalperson = await _physicalpersonService.FindByIdAsync(id.Value);

            if (physicalperson == null)
            {
                return(NotFound());
            }
            List <Shippingway>          shippingways  = _shippingwayService.FindAll();
            List <Saleschannel>         saleschannels = _saleschannelService.FindAll();
            List <Plan>                 plans         = _planService.FindAll();
            PhysicalpersonFormViewModel viewModel     = new PhysicalpersonFormViewModel
            {
                Physicalperson = physicalperson,
                Shippingways   = shippingways,
                Saleschannels  = saleschannels,
                Plans          = plans
            };

            return(View(viewModel));
        }