using MongoDB.Driver;
namespace ET
{
///
/// 用来缓存数据
///
public class DBComponent: Entity, IAwake, IDestroy
{
public const int TaskCount = 32;
public MongoClient mongoClient;
public IMongoDatabase database;
public IMongoCollection GetCollection(string collection = null)
{
return this.database.GetCollection(collection ?? typeof (T).Name);
}
public IMongoCollection GetCollection(string name)
{
return this.database.GetCollection(name);
}
}
}