dotnet / dotnet/command-line-api

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

Offen
#1,455 9 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Area-Hosting and DI
Vorherrschende Sprache
C#
Sterne
3.7k
Forks
428
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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) ?

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Das Issue erwähnt ServiceCollection und den command-line-api-.UseHost-Einstiegspunkt, nennt aber keine Dateien oder Tests. Überprüfe zunächst die bestehende Unterstützung für .UseHost und alle Anwendungsbeispiele. Ermittle dann, ob die direkte Dependency Injection mit ServiceCollection unterstützt wird und welche Dokumentation erforderlich wäre; abgeschlossen ist die Aufgabe, wenn ein klares Beispiel bereitgestellt oder die Integrationsfrage beantwortet wurde.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp
Bereich
cli, documentation
Issue-Typ
Dokumentation
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
20/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.