How to execute a method everytime before/after executing some other method which has many overloads?

前端 未结 2 1353
被撕碎了的回忆
被撕碎了的回忆 2021-01-06 09:51

I have an existing application which is already developed and is in use.

There are multiple overloads of one of the methods (called Read()) of a class. Now I want t

2条回答
  •  感情败类
    2021-01-06 10:28

    You need to use an Interceptor / AoP. The first options that jump to mind are PostSharp and Microsoft Unity.

    There's a very good article on this sort of thing in this months MSDN magazine: http://msdn.microsoft.com/en-us/magazine/gg490353.aspx

提交回复
热议问题