private void GetNocQuestion(HatzolahOrm orm, HatzolahNoc noc) { var nocQuestionResult = orm.Question.Select(x => new { x.Question, x.QuestionId }).Where(m => m.QuestionId == noc.QuestionId).FirstOrDefault(); if (nocQuestionResult != null) { noc.Question = nocQuestionResult.Question; } }
public Dictionary <int, string> GetAllNocs() { using (HatzolahOrm orm = new HatzolahOrm(connectionString)) { var nocList = orm.NocCodes.ToDictionary(x => x.Id, x => x.Description + " NOC: " + x.Noc); return(nocList); } }
public HatzolahNoc GetNoc(int id) { var orm = new HatzolahOrm(connectionString); var noc = orm.NocCodes.Where(x => x.Id == id).FirstOrDefault(); if (noc != null) { var nocMapped = MapNoc(noc); if (noc.QuestionId != null) { GetNocQuestion(orm, nocMapped); } return(nocMapped); } return(noc); }