On the following code:
var serializer = new XmlSerializer(typeof(MyPOCOType));
using (var reader = XmlReader.Create(fileName))
{
var pocoInstance = (MyPOCOType)serializer.Deserialize(reader);
}
I am using ninject.
The MyPOCOType has an dependency that is passed by constructor injection.
The instance of MyPOCOType is being created by the Deserialize method, so the dependencies are not provided.
There are another way to do that without separate the state from my MyPOCOType and without use [Inject] attribute? (still using Constructor injection)