The code:
public class TheFilter : ActionFilterAttribute { public override void OnActionExecuted(ActionExecutedContext filterContext) { var controllerName = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName; } } public class NotesController : BaseController { [TheFilter] [HttpPost] public ActionResult Edit(EditViewModel viewModel) { viewModel.Note.Modified = DateTime.Now; viewModel.Note.ModifiedBy = User.Identity.Name; var noteTable = StorageHelper.GetTable<Note>(viewModel.PageMeta.DataSourceID); noteTable.AddOrUpdate(viewModel.Note); return Home(); } } When I debug on return Home() and step through then I bypass the action filter and go straight to the Home() method.
Am I declaring the action filter correctly?
OnActionExecutingand put a breakpoint in it? I'm curious if it gets hit.