public static StorageNode BuildNode(Domain parentDomain, NodeConfiguration nodeConfiguration) { ArgumentValidator.EnsureArgumentNotNull(parentDomain, "parentDomain"); ArgumentValidator.EnsureArgumentNotNull(nodeConfiguration, "nodeConfiguration"); nodeConfiguration.Validate(parentDomain.Configuration); if (!nodeConfiguration.IsLocked) { nodeConfiguration.Lock(); } var context = new UpgradeContext(parentDomain, nodeConfiguration); using (context.Activate()) using (context.Services) { new UpgradingDomainBuilder(context).Run(); return(context.StorageNode); } }
public static async Task <StorageNode> BuildNodeAsync( Domain parentDomain, NodeConfiguration nodeConfiguration, CancellationToken token) { ArgumentValidator.EnsureArgumentNotNull(parentDomain, nameof(parentDomain)); ArgumentValidator.EnsureArgumentNotNull(nodeConfiguration, nameof(nodeConfiguration)); nodeConfiguration.Validate(parentDomain.Configuration); if (!nodeConfiguration.IsLocked) { nodeConfiguration.Lock(); } var context = new UpgradeContext(parentDomain, nodeConfiguration); using (context.Activate()) using (context.Services) { await new UpgradingDomainBuilder(context).RunAsync(token).ConfigureAwait(false); return(context.StorageNode); } }
public static Domain Build(DomainConfiguration configuration) { ArgumentValidator.EnsureArgumentNotNull(configuration, "configuration"); if (configuration.ConnectionInfo == null) { throw new ArgumentException(Strings.ExConnectionInfoIsMissing, "configuration"); } if (!configuration.IsLocked) { configuration.Lock(); } LogManager.Default.AutoInitialize(); var context = new UpgradeContext(configuration); using (context.Activate()) using (context.Services) { return(new UpgradingDomainBuilder(context).Run()); } }
public static async Task <Domain> BuildAsync(DomainConfiguration configuration, CancellationToken token) { ArgumentValidator.EnsureArgumentNotNull(configuration, nameof(configuration)); if (configuration.ConnectionInfo == null) { throw new ArgumentException(Strings.ExConnectionInfoIsMissing, nameof(configuration)); } if (!configuration.IsLocked) { configuration.Lock(); } LogManager.Default.AutoInitialize(); var context = new UpgradeContext(configuration); using (context.Activate()) using (context.Services) { return(await new UpgradingDomainBuilder(context).RunAsync(token).ConfigureAwait(false)); } }