coder / coder/coder-desktop-windows

Use dependency injection in more places

Abierto
#80 0 comentarios 0 reacciones 1 asignado Reclamado por @deansheather Ver en GitHub
Lenguaje dominante
C#
Estrellas
26
Forks
12
Merge medio
6 h 50 min
PR fusionados (30 d)
1

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.