use the Attributes to implement the filter function likes the actionfilters in ASP.NET MVC