コード例 #1
0
 public void Export(DataAccessObject.DataAccessObject strategy)
 {
     foreach (Type type in this.Types)
     {
         strategy.CreateSchema(type);
     }
     foreach (Type type in this.Types)
     {
         foreach (Entity e in this.Entities[type])
         {
             strategy.SaveEntity(e);
         }
     }
 }
コード例 #2
0
 public void Init(List <Type> types, DataAccessObject.DataAccessObject strategy, bool debug)
 {
     // dataAccessObject = new SQLiteStrategy("db.sqlite", types, debug);
     //dataAccessObject = new MysqlStrategy("localhost","test", "root", "", types, debug);
     //dataAccessObject = new XmlStrategyPrototype();
     dataAccessObject = strategy;
     Types            = types;
     Entities         = new Dictionary <Type, List <Entity> >();
     NextId           = new Dictionary <Type, int>();
     _Mementos        = new List <Memento>();
     Mementos         = new List <Dictionary <Entity, bool> >();
     foreach (Type type in Types)
     {
         CreateSchema(type);
         NextId[type] = dataAccessObject.GetNextId(type);
         //NextId[entry.Value] = 1;
         Entities[type] = new List <Entity>();
     }
     Pull();
 }
コード例 #3
0
 public EntityRepository(List <Type> types, DataAccessObject.DataAccessObject strategy, bool debug)
 {
     Init(types, strategy, debug);
 }
コード例 #4
0
 public EntityRepository(List <Type> types, DataAccessObject.DataAccessObject strategy)
 {
     Init(types, strategy, false);
 }