Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Use dependency injection in more places

Aperta
#80 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@deansheather ci sta già lavorando.

Dal 8/5/2025.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

In some places where we need to pass parameters that aren't DI-able, we are using a pattern of DI-ing the fields to the "parent" and then passing them to the new child without using DI.

Ideally we use DI as much as possible and not pass stuff down. We may need to use factories to accomplish this.

E.g.

class MyClass(ISomethingProvider somethingProvider)
{
  public ChildClass CreateChild(string myParam)
  {
    return new ChildClass(somethingProvider, myParam);
  }
}

https://github.com/coder/coder-desktop-windows/blob/a58864eb60643309cce9d0aa67681fff551ff1b8/App/Views/FileSyncListWindow.xaml.cs#L19

Also the yet to be merged remote directory picker contains an instance of this too.

Lingua principale
C#
Stelle
29
Fork
12
Merge medio
4h 15m
PR unite (30g)
2

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di coder/coder-desktop-windows

Tutte le issue di coder/coder-desktop-windows

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.