coder / coder/coder-desktop-windows

Use dependency injection in more places

Ouverte
#80 0 commentaires 0 réactions 1 personne assignée Réclamée par @deansheather Voir sur GitHub
Langage dominant
C#
Étoiles
26
Forks
12
Merge moyen
6 h 50 min
PR mergées (30 j)
1

Description

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.

```cs
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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.