c# - How can get access to Unity container in a class library ActionFilterAttribute? -


so, have web project utilizes unity inject userrepository interfaces iuserrepository. have class library contains custom actionfilterattribute. custom attribute class used on many actions already. want add code check value in database based on user. this, need access userrepository. old fashioned way using statements , directly access userrepository, utilize di , resolve iuserrepository. how can access web resolving iuserrepository to, inside custom attribute class since actionfilterattribute needs empty constructor?

attributes metadata objects. shouldn't involved in database access. use separate service read attribute values , result access database.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -