Esempio n. 1
0
 public override void AddCommand(StorageCommand command)
 {
     if (_locked)
     {
         throw new Exception("The mediator is locked");
     }
     if (command.Mode == StorageCommandMode.Entity)
     {
         if (!_builders.ContainsKey(command.EntityType))
         {
             _builders.Add(command.EntityType, new SqlScriptBuilder(new Mapper(command.EntityType, _ps), _ps));
         }
         _list.Add(command);
     }
     else
     {
         if (!_mtmRelationships.ContainsKey(command.ManyToManyProperty))
         {
             List <EntityBase> l = new List <EntityBase>();
             l.AddRange(command.Entities);
             _mtmRelationships.Add(command.ManyToManyProperty, l);
         }
         else
         {
             foreach (EntityBase e in command.Entities)
             {
                 if (!_mtmRelationships[command.ManyToManyProperty].Contains(e))
                 {
                     _mtmRelationships[command.ManyToManyProperty].Add(e);
                 }
             }
         }
     }
 }
Esempio n. 2
0
 public override void AddCommand(StorageCommand command)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Esempio n. 3
0
 public abstract void AddCommand(StorageCommand command);