Exemple #1
0
        public HelloModule(Stopwatch watch, IHelloRepository repo) : base("api")
        {
            this.repo = repo;

            this.watch = watch;
            this.watch.Restart();

            this.Get <HelloRequest, HelloResponse>(nameof(Hello), HelloOp);
        }
Exemple #2
0
 public BotAnswerer()
 {
     _questionRepository = new QuestionRepository(QuestionRepositoryFilePath);
     _aphorismRepository = new AphorismsRepository(AphorismRepositoryFilePath);
     _byeRepository      = new ByeRepository(ByeRepositoryFilePath);
     _helloRepository    = new HelloRepository(HelloRepositoryFilePath);
     _jokesRepository    = new JokesRepository(JokesRepositoryFilePath);
     _myNameRepository   = new MyNameRepository(MyNameRepositoryFilePath);
 }
Exemple #3
0
        public PhotoController(IHelloRepository repo, IMapper mapper, IOptions <CloudinarySettings> cloudinarySettings)
        {
            _cloudinarySettings = cloudinarySettings;
            _repo   = repo;
            _mapper = mapper;
            var account = new Account(_cloudinarySettings.Value.CloudName,
                                      _cloudinarySettings.Value.ApiKey,
                                      _cloudinarySettings.Value.ApiSecret);

            _cloudinary = new Cloudinary(account);
        }
Exemple #4
0
        public HelloModule(IHelloRepository repository, AppSettings settings)
        {
            int cacheTimespan = settings.Cache.CacheTimespan;

            Get <GetHello>("/Hello/{name}", (req, res) =>
            {
                string name = req.RouteValues.As <string>("name");

                return(res.ExecHandler(cacheTimespan, () => repository.SayHello(name)));
            });
        }
        public BotThread()
        {
            Questions = new Queue <string>();
            _cancellationTokenSource = new CancellationTokenSource();

            _questionRepository = new QuestionRepository(QuestionRepositoryFilePath);
            _aphorismRepository = new AphorismsRepository(AphorismRepositoryFilePath);
            _byeRepository      = new ByeRepository(ByeRepositoryFilePath);
            _helloRepository    = new HelloRepository(HelloRepositoryFilePath);
            _jokesRepository    = new JokesRepository(JokesRepositoryFilePath);
            _myNameRepository   = new MyNameRepository(MyNameRepositoryFilePath);
        }
Exemple #6
0
 public MessageController(IHelloRepository repo, IMapper mapper)
 {
     _repo   = repo;
     _mapper = mapper;
 }
Exemple #7
0
 public HelloActorService(ILogger <HelloActorService> logger, IStateManager stateManager, IHelloRepository helloRepository)
 {
     this.logger          = logger;
     this.stateManager    = stateManager;
     this.helloRepository = helloRepository;
 }
 public HelloController(IHelloRepository helloRepository)
 {
     HelloRepository = helloRepository;
 }
 public HelloServiceGrpcImpl(IHelloRepository helloRepository)
 {
     _helloRepository = helloRepository;
 }
Exemple #10
0
 public SayHelloControllerTests()
 {
     languageCodeValidator = Substitute.For <ILanguageCodeValidator>();
     hellosRepository      = Substitute.For <IHelloRepository>();
     controller            = new SayHelloController(languageCodeValidator, hellosRepository);
 }
 public SayHelloController(ILanguageCodeValidator languageCodeValidator,
                           IHelloRepository hellosRepository)
 {
     this.languageCodeValidator = languageCodeValidator;
     this.hellosRepository      = hellosRepository;
 }
Exemple #12
0
 public HelloWorldService(IHelloRepository repository)
 {
     _repository = repository;
 }
Exemple #13
0
 public HelloService(IHelloRepository helloRepository)
 {
     this.HelloRepository = helloRepository;
 }