Workaround for C# generic attribute limitation

前端 未结 3 1995
遇见更好的自我
遇见更好的自我 2021-01-07 23:52

As discussed here, C# doesn\'t support generic attribute declaration. So, I\'m not allowed to do something like:

[Audit (UserAction.Update)]
publ         


        
3条回答
  •  半阙折子戏
    2021-01-08 00:15

    You could use reflection to invoke the LoadById method. The following msdn article should point you in the right direction:

    http://msdn.microsoft.com/en-us/library/b8ytshk6(v=vs.100).aspx

提交回复
热议问题