Exemplo n.º 1
0
 private static void AddDelegator(IPersistenceProvider iPersistenceProvider, IPersistenceProvider engine)
 {
     PropertyInfo delegatorsProperty = engine.GetType().GetProperty("Delegators");
     List<IPersistenceProvider> delegators;
     if (delegatorsProperty.GetValue(engine, null) == null)
         delegators = new List<IPersistenceProvider>();
     else
         delegators = new List<IPersistenceProvider>((IEnumerable<IPersistenceProvider>)delegatorsProperty.GetValue(engine, null));
     delegators.Add(iPersistenceProvider);
     delegatorsProperty.SetValue(engine, delegators.ToArray(), null);
 }