Value cannot be null in sportstore exampe
Posted
by Naim
on Stack Overflow
See other posts from Stack Overflow
or by Naim
Published on 2010-04-16T11:47:01Z
Indexed on
2010/04/16
12:33 UTC
Read the original article
Hit count: 225
Hi everyone,
I am having this problem when I want to implement IoC for sportstore example. The code
public WindsorControllerFactory(){
container = new WindsorContainer( new XmlInterpreter(new ConfigResource("castle"))
);
var controllerTypes= from t in Assembly.GetExecutingAssembly().GetTypes()
where typeof(IController).IsAssignableFrom(t)
select t;
foreach (Type t in controllerTypes)
container.AddComponentLifeStyle(t.FullName, t, LifestyleType.Transient);
}
protected override IController GetControllerInstance(Type controllerType)
{
return (IController)container.Resolve(controllerType);
}
}
The error said that the value cannot be null in the GetControllerInstance
Any help will be appreciated !
Thanks! Naim
© Stack Overflow or respective owner