Is there a way I can create custom method attributes for WCF that allow me to easily decorate a service method with a pre filter much like MVC uses action filters. I plan to use them for authentication and authorization. This is for a RESTful service whose requests are carrying an authentication cookie.
I am more interested in how to create the attributes rather than the authentication side of things. Does the HTTP Toolkit offer anything?
Thanks
ASP.NET MVC provides Action Filters for executing filtering logic either before or after an action method is called. Action Filters are custom attributes that provide declarative means to add pre-action and post-action behavior to the controller's action methods.
WCF has great extensibility - in many ways. You can encapsulate lots of functionality into e.g. service and/or operation behaviors, which can be attached to a service or operation by means of an attribute.
Check out the current DotNet Rocks TV Show #202 with Miguel Castro on WCF extensibility - it should give you an idea of what is possible (and lots more is possible, for sure!)
See also:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With