是否可以将Loggin行为注入标记的类或/和方法,如下所示:
Log("Method {0} started",GetMethodNameTroughReflection)
Call method body
Log("Method {0} Finished",GetMethodNameTroughReflection)
Run Code Online (Sandbox Code Playgroud)
我想创建自己的Attribute类,它将实现方法调用的记录行为.
我想描述app.config文件中的登录行为,可以通过config中的设置禁用它.
怎么做对了?也许为这样的任务创建了解决方案?
| 归档时间: |
|
| 查看次数: |
4051 次 |
| 最近记录: |