/// <summary> /// Configures the Ncqrs environment. /// </summary> /// <param name="source">The source that contains the configuration for the current environment.</param> public static void Configure(IEnvironmentConfiguration source) { Contract.Requires <ArgumentNullException>(source != null, "The source cannot be null."); Contract.Requires <InvalidOperationException>(!IsConfigured, "Cannot configure the environment when it is already configured."); Contract.Ensures(_instance == source, "The given source should initialize the _instance member."); Contract.Ensures(IsConfigured, "The given source should configure this environment."); _instance = source; Log.InfoFormat("Ncqrs environment configured with {0} configuration source.", source.GetType().FullName); }