Example #1
0
        public async Task <ShibaConfigModel> LoadAsync()
        {
            _connection = await ConnectionFactory.ConnectAsync();

            SqliteCommand query = _connection.CreateCommand();

            query.CommandText += "select * from ShibaConfig;";

            SqliteDataReader reader = await query.ExecuteReaderAsync();

            ShibaConfigModel shibaConfig = null;

            if (await reader.ReadAsync())
            {
                shibaConfig = new ShibaConfigModel(Convert.ToUInt64(reader["OwnerID"]), reader["Token"].ToString(), reader["MongoConnectionString"].ToString());
            }

            await _connection.CloseAsync();

            await _connection.DisposeAsync();

            return(shibaConfig);
        }
Example #2
0
 public Main(ShibaConfigModel shibaConfig)
 {
     _shibaConfig = shibaConfig;
 }
Example #3
0
        public static void Connect(ShibaConfigModel shibaConfig)
        {
            MongoClient client = new MongoClient(shibaConfig.MongoConnectionString);

            database = client.GetDatabase("shiba_db");
        }