@@ -32,8 +32,6 @@ namespace SeqCli.Cli.Commands.ApiKey;
3232 Example = "seqcli apikey create -t 'Test API Key' -p Environment=Test" ) ]
3333class CreateCommand : Command
3434{
35- readonly SeqConnectionFactory _connectionFactory ;
36-
3735 readonly ConnectionFeature _connection ;
3836 readonly PropertiesFeature _properties ;
3937 readonly OutputFormatFeature _output ;
@@ -43,10 +41,8 @@ class CreateCommand : Command
4341 string [ ] ? _permissions ;
4442 bool _useServerTimestamps , _connectPasswordStdin ;
4543
46- public CreateCommand ( SeqConnectionFactory connectionFactory )
44+ public CreateCommand ( )
4745 {
48- _connectionFactory = connectionFactory ?? throw new ArgumentNullException ( nameof ( connectionFactory ) ) ;
49-
5046 Options . Add (
5147 "t=|title=" ,
5248 "A title for the API key" ,
@@ -189,13 +185,13 @@ protected override async Task<int> Run()
189185 _connectPassword = await Console . In . ReadLineAsync ( ) ;
190186 }
191187
192- var ( url , _) = _connectionFactory . GetConnectionDetails ( _connection , config ) ;
188+ var ( url , _) = SeqConnectionFactory . GetConnectionDetails ( _connection , config ) ;
193189 connection = new SeqConnection ( url ) ;
194190 await connection . Users . LoginAsync ( _connectUsername , _connectPassword ?? "" ) ;
195191 }
196192 else
197193 {
198- connection = _connectionFactory . Connect ( _connection , config ) ;
194+ connection = SeqConnectionFactory . Connect ( _connection , config ) ;
199195 }
200196
201197 return connection ;
0 commit comments