dotnet / dotnet/command-line-api

Question: Usage models with Service Collection (not using Generic Host)

Aperta
#1,455 9 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Area-Hosting and DI
Lingua principale
C#
Stelle
3.7k
Fork
428
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I have been using a different cli library, that has some great features, and is very usable, but lacks functionality such as tab completion (per `dotnet`suggest`) However it does work well with using a raw ServiceCollection and provides the ability to inject those services into commands.

Im assessing the lift to migrate.

I see that `command-line-api` has Host Builder support (via `.UseHost` by scanning issues - open and closed) bit not specific documentation.

Are there any examples out there of just using the ServiceCollection with DI support (the other library uses reflection)?

One hopes in-time that (as other libraries) the DI integration is not tightly integrated such that one can use different services containers (albeit in the other library once would need to write a custom `Convention` vs the included DI one to achieve this) ?

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

La issue menziona ServiceCollection e l’entry point .UseHost di command-line-api, ma non indica file né test. Esamina innanzitutto il supporto esistente per .UseHost e gli eventuali esempi di utilizzo, quindi stabilisci se è supportata la dependency injection diretta di ServiceCollection e quale documentazione sarebbe necessaria; il lavoro è completato quando viene fornito un esempio chiaro oppure viene data una risposta alla domanda sull’integrazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
cli, documentation
Tipo di issue
Documentazione
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
20/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.