Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Use dependency injection in more places

未关闭
#80 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@deansheather 已经在做这个了。

开始于 2025年5月8日。

评估

这个 Issue 还没有评估数据。

描述

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.

主要语言
C#
星标
29
派生
12
平均合并
4 小时 15 分钟
30 天内合并 PR
2

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

coder/coder-desktop-windows 的其他 Issue

查看 coder/coder-desktop-windows 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。