I was wondering if it is possible to implement a special ActionFilterAttribute
using an IoC container . / P>
For example, a TransactionAttribute
class [transactions]
create, consider whether you Use it to decorate the action that firmly follows a transaction. But the implementation details of the attribute will be related to the firmness technology you are using, and strictly speaking, your controller should not know about it, and you want to swap it out.
What I want to do, defines some kind of TransactionAttribute
interface, and then my IoC containers inject the correct implementation so that only in my actions should I specify Required:
[transaction] Public functioning some actions () {....}
... and the correct implementation based on IOC config ( such as NHibernateTransactionAttribute
, or SomeOtherORMTransactionAttribute
some] Injeksh
Is it possible? Has anyone done this?
You should give this idea how you should get it.
Comments
Post a Comment