コード例 #1
0
        internal RulesAndRegulations GetRules()
        {
            RulesAndRegulations rulesAndRegulations = null;
            string rulesJsonFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, RepositoryConstant.SUB_FOLDER_NAME, RepositoryConstant.RULES_JSON_FILE_NAME);

            if (!string.IsNullOrEmpty(rulesJsonFilePath))
            {
                JsonToClassConverter jsonToClassConverter = new JsonToClassConverter();
                rulesAndRegulations = jsonToClassConverter.ConvertJsonToClassObject <RulesAndRegulations>(rulesJsonFilePath);
            }
            return(rulesAndRegulations);
        }
コード例 #2
0
        internal List <QuestionsAnswer> GetQuestionsAnswers()
        {
            List <QuestionsAnswer> qustionAnswers = null;
            string questionsAnswerJsonFilePath    = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, RepositoryConstant.SUB_FOLDER_NAME, RepositoryConstant.QUESTION_ANSWER_JSON_FILE_NAME);

            if (!string.IsNullOrEmpty(questionsAnswerJsonFilePath))
            {
                JsonToClassConverter jsonToClassConverter = new JsonToClassConverter();
                qustionAnswers = jsonToClassConverter.ConvertJsonToClassObject <QuestionList>(questionsAnswerJsonFilePath)?.Questions;
            }
            return(qustionAnswers);
        }