ASP.Net MVC filters

Associate
Joined
25 Feb 2007
Posts
905
Location
Midlands
Hi,

I'm using MVC 5 and Entity Framework 6.

Say I have a Cases controller with an Index action that returns all cases to an Index view, but then I wanted to implement a My Cases feature (e.g. where case assigned to == User.Identity.Name) how would you go about this?

At the moment I've created a second action MyCases, which replicates the Index action functionality but with the added Where filter. This action still uses the Index view, just passing in an amended model object.

This works well, but I have an issue now where say I click on Edit for a Case displayed via the My Cases, the Post action redirects back to the Index action, rather than the action it came from.

I'm looking in to resolving this, but feel like I might not have implemented the MyCases feature in the best way initially! Any thoughts?
 
Back
Top Bottom