coder / coder/coder-desktop-windows
Use dependency injection in more places
- Ngôn ngữ chính
- C#
- Star
- 26
- Fork
- 12
- Merge trung bình
- 6 giờ 50 phút
- Pull request đã merge (30 ngày)
- 1
Mô tả
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.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.