Jump to content

Anyone familiar with reflection in MVC?

Jitsu

Hey all,

 

I'm looking to chat with someone who has some experience using reflection in MVC applications.

Basically, I'd like to annotate a few controller actions with two strings that I can get a unique list of and link to user accounts.

 

The concept behind it is, I annotate an action like so:

[ActionEvent("Group Name", "Event Name")]public JsonResult MyEventMethod(int id){...}

On startup, generate a list of these action events and store them in a table with id's etc..

I then want to be able to link these action id's to a user, so in the user control view, render a check list of them and add/remove the link as appropriate.

When an action with an action event annotation is called, I want it to be able to check it's own annotation and get a list of users with links to that annotation.

I then want to use that list of users in that event.

 

In lamens terms I want to create a "subscription" to that method call, that users can optionally be "subscribed to" and receive notifications when that method call is run.

 

Hope that makes sense :blink:

If anyone can offer up some advice that would be awesome! xD

Link to comment
Share on other sites

Link to post
Share on other sites

I don't really do any reflection but I'll try to help anyway, sorry in advance if it doesn't. This should get you access to all the Controller classes. This should help get you the methods with that attribute.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×