Exemple #1
0
        public MainViewModel()
        {
            TelegramChat = new TelegramFeedViewModel();
            Signals      = new ObservableCollection <SignalVM>();

            _telegramBot.OnMessage += OnMessage;
            _telegramBot.OnSignal  += OnSignal;
            _telegramBot.Initialize();
        }
Exemple #2
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc(option =>
            {
                option.EnableEndpointRouting   = false;
                option.ReturnHttpNotAcceptable = true;
                // option.Filters.Add(typeof(ModelValidationFilter));
            })
            .AddXmlSerializerFormatters()
            .AddJsonOptions(opts => opts.JsonSerializerOptions.PropertyNamingPolicy = null);

            //services.AddMemoryCache();

            services.AddTransient(_config);
            services.AddScoped(_config);
            services.AddSingleton(_config);

            services.AddHostedService <QuartzHostedService>();
            TelegramBot.Initialize(_config["NotifierSettings:TelegramBotToken"]);
        }