public IActionResult New(int?bankId) { if (bankId != null) { BankSaveModel bankSaveModel = new BankSaveModel(); Bank bank = _bankService.Set().Single(s => s.ID == bankId); bankSaveModel.BankModel = new BankModel() { ID = bank.ID, Name = bank.Name, URL = bank.URL }; ContactPerson contactPerson = _contactPersonService.Set().Single(s => s.BankID == bankId && s.PositionID == _positionService.Set().Single(ss => ss.Name.Equals("General Director")).ID); bankSaveModel.ContactPersonModel = new ContactPersonModel() { FirstName = contactPerson.FirstName, LastName = contactPerson.LastName, DateOfBirth = contactPerson.DateOfBirth }; return(View(bankSaveModel)); } return(View(new BankSaveModel())); }