コード例 #1
0
        public static UserQueryExecutor Create(PluginInitContext context)
        {
            var deserializer     = new JsonNetDeserializer();
            var stackOverflowApi = new StackOverflowApi(deserializer);
            var orderStrategy    = new ByAnsweredAndScoreQuestionsOrderStrategy();

            var questionResultBuilder = new QuestionResultBuilder(context.API, orderStrategy);

            return(new UserQueryExecutor(stackOverflowApi, questionResultBuilder));
        }
コード例 #2
0
        public UserQueryExecutor(IStackOverflowApi stackOverflowApi, QuestionResultBuilder questionResultBuilder)
        {
            if (stackOverflowApi == null)
            {
                throw new ArgumentNullException(nameof(stackOverflowApi));
            }
            if (questionResultBuilder == null)
            {
                throw new ArgumentNullException(nameof(questionResultBuilder));
            }

            _stackOverflowApi      = stackOverflowApi;
            _questionResultBuilder = questionResultBuilder;
        }