Specify required base class for .NET attribute targets

后端 未结 3 434
孤独总比滥情好
孤独总比滥情好 2020-12-10 04:54

I tried to create a custom .NET attribute with the code below but accidentally left off the subclass. This generated an easily-fixed compiler error shown in the comment.

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-10 05:29

    With ReSharper you can use [JetBrains.Annotations.BaseTypeRequired(typeof(YouBaseType))]

提交回复
热议问题