Пример #1
0
        public GameDatabase(IConfigurationRoot configurationRoot, HttpClient client, bool verbose = false, bool debug = false)
            : base(configurationRoot, client)
        {
            Verbose = verbose;
            Debug   = debug;

            var    configDatabase = configurationRoot.GetSection("Database").Get <Dictionary <string, string> >();
            string useSecret      = configDatabase["useSecret"];

            db = new MongoCRUD(configDatabase[useSecret], "PiskvorkyJobsCZ");
        }
Пример #2
0
        public GameTokenValidator(IConfigurationRoot configurationRoot, HttpClient client)
        {
            ConfigurationRoot = configurationRoot;
            Client            = client;

            var    configDatabase = configurationRoot.GetSection("Database").Get <Dictionary <string, string> >();
            string useSecret      = configDatabase["useSecret"];

            db = new MongoCRUD(configDatabase[useSecret], "PiskvorkyJobsCZ");

            UserToken = configurationRoot.GetSection("userToken").Get <string>();
            UserId    = configurationRoot.GetSection("userId").Get <string>();
            UserGuid  = new Guid(UserId);

            log = new LoggerConfiguration()
                  .WriteTo.File("logExceptions.txt")
                  .CreateLogger();
        }