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)); }
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; }