extension method for a method C# -


is there way have extension method on method? example method takes user object parameter , need security check if user can use method @ beginning of method. can method have extension method "check can user use me" , return bool.

thanks.

you can use aspect oriented programming (aop) implement cross-cutting security checks in code.

in .net have choice of several aop frameworks, example:

in particular postsharp documentation has some nice examples on how implement security using aop.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -