Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我尝试过使用 AttributeTargetTypes,但它不起作用。我错过了什么?
将切面应用于类的所有方法的最简单方法是使用切面自定义属性注释此类。AttributeTargetTypes,当自定义属性应用于程序集级别时,也应该工作,至少如果类型是当前程序集的一部分。