inject different implementations by logged User Role
Posted
by Omu
on Stack Overflow
See other posts from Stack Overflow
or by Omu
Published on 2010-03-25T15:13:11Z
Indexed on
2010/03/25
20:33 UTC
Read the original article
Hit count: 415
asp.net-mvc
|ioc-container
|inversion-of-control
|dependency-injection
|castle-windsor
public class TheController : Controller
{
IThe the;
public TheController( IThe the)
{
//when User.IsInRole("r1") The1 should be injected else r2
this.the = the;
}
}
public class The1 : IThe{}
public class The2 : IThe{}
//anybody knows a good way of doing this ?
© Stack Overflow or respective owner