public void AddParty(PARTY newParty) { using (var ctx = new ElectionSqliteContext()) { ctx.PARTies.Add(newParty); ctx.SaveChanges(); } }
private ICollection <ANSWER> getAnswers(PARTY party) { List <ANSWER> retList = new List <ANSWER>(); foreach (var wahlAnswer in party.ANSWERs) { retList.Add(new ANSWER() { ID = wahlAnswer.ID, PARTY = wahlAnswer.PARTY, QUESTION = wahlAnswer.QUESTION, QUESTIONnav = wahlAnswer.QUESTIONnav, OPTION = wahlAnswer.OPTION, OPTIONnav = wahlAnswer.OPTIONnav }); } return(retList); }