/// <summary> /// Creates and Configures a new PersistenceQueue using a fluent interface. /// The Types are inserted into the database in the order they are defined in the configurationAction. /// They should be defined in the order of dependency...in the order they should be inserted into the db. /// </summary> /// <param name="configurationAction">The configuration action.</param> /// <returns></returns> public static PersistenceQueue Create(Action <PersistenceQueueBuilder> configurationAction) { // Execute the configuration action provided. var persistenceQueueBuilder = new PersistenceQueueBuilder(); configurationAction.Invoke(persistenceQueueBuilder); // Create a new PersistenceQueue initializing it from the PersistenceQueueBuilder's values. var persistenceQueue = new PersistenceQueue(); foreach (IInstanceQueueBuilder builder in persistenceQueueBuilder.InstanceQueueBuilders) { persistenceQueue.AddInstanceQueue(builder); } return(persistenceQueue); }
/// <summary> /// Initializes a new instance of the <see cref="TypeQueue"/> class. /// </summary> /// <param name="parent">The parent.</param> public TypeQueue(PersistenceQueue parent) { InstanceQueues = new Dictionary <Type, IInstanceQueue>(); TypeOrder = new List <Type>(); Parent = parent; }