protected override void Validate() { base.Validate(); if (!Assembly.HasValue()) { throw new CommandException(string.Format(MyResources.MissingOption, Assembly.LongName)); } if (ConnectionString.HasValue() || ConnectionProvider.HasValue()) { if (!ConnectionString.HasValue()) { throw new CommandException(string.Format(MyResources.MissingOption, ConnectionString.LongName)); } if (!ConnectionProvider.HasValue()) { throw new CommandException(string.Format(MyResources.MissingOption, ConnectionProvider.LongName)); } if (ConnectionStringName.HasValue()) { throw new CommandException( string.Format( MyResources.MutuallyExclusiveOptions, ConnectionStringName.LongName, ConnectionString.LongName)); } } }
internal void Populate(Settings settings) { var storeSettings = settings.Store; if (Type.HasValue()) { storeSettings.Type = Type; } if (Path.HasValue()) { storeSettings.Path = Path; } if (ConnectionString.HasValue()) { storeSettings.ConnectionString = ConnectionString; } #if !NETSTANDARD2_0 if (ConnectionStringName.HasValue()) { storeSettings.ConnectionStringName = ConnectionStringName; } #endif if (Size.HasValue) { storeSettings.Size = Size.Value; } if (RollupSeconds.HasValue) { storeSettings.RollupPeriod = TimeSpan.FromSeconds(RollupSeconds.Value); } if (BackupQueueSize.HasValue) { storeSettings.BackupQueueSize = BackupQueueSize.Value; } }