private static void InsertMissingTypes(IEnumerable <OpenTriviaDb.Result> validQuestions) { foreach (var type in validQuestions.Select(r => r.Type)) { if (QuestionType.Select(type) == null) { var newQuestionType = new QuestionType { Name = type }; newQuestionType.Insert(); } } }