public void AddModelElection(RegistrationData registrationData) { var getVoterObj1 = new ElectionCandidate(); var getVoterObj2 = new ElectionCandidate(); getVoterObj1 = _getService.GetElectionCandidate((int)registrationData.CID1); getVoterObj2 = _getService.GetElectionCandidate((int)registrationData.CID2); _addingService.AddElection(new MakeElection { CID1 = registrationData.CID1, CDName1 = getVoterObj1.Name, CID2 = registrationData.CID2, CDName2 = getVoterObj2.Name, ElectionName = registrationData.ElectionName, ElectionDate = registrationData.ElectionDate, Count1 = 0, Count2 = 0 }); }