作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
在我们的代码中,我们有自己的注入(inject)框架来启用依赖注入(inject),例如:
public class MyClass {
[Component("ComponentName1")] // means [NotNull]
public MyType NotNullComponent{ get; set; }
[OptionalComponent("ComponentName2")] // means [CanBeNull]
public MyType CanBeNullComponent { get; set; }
}
我们不想再次在所有地方添加 [CanBeNull]
或 [NotNull]
,因为它与 [Component]
有重复的语义和 [OptionalComponent]
属性。
是否可以让ReSharper知道自定义属性的语义来帮助静态分析?
最佳答案
关于c# - ReSharper:如何使用另一个属性隐式应用 [NotNull] 或 [CanBeNull] 注释?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35660579/
我是一名优秀的程序员,十分优秀!