I would think you could use any IOC container you like - you just have to make sure you create a constructor that passes in all the dependencies you might need.
I'm not sure how using IOC would really help much in the typical usage scenario because you're basically dealing with a static property somewhere (ie. App.Configuration) rather than something that's repeatedly instantiated so it's declared in one place typically (the static constructor).
Hi Rick,
I've been looking for a solution to inject configuration settings into controllers and service classes, much like the one detailed in the LosTechies article:
http://lostechies.com/joshuaflanagan/2009/07/13/how-we-handle-application-configuration/
I think your solution may do the trick, but I wanted to know how suitable you think it is for use in a case like the following and using structuremap. In this example AvatarSettings inherits from Westwind.Utilities.Configuration.AppConfiguration
public AvatarService(AvatarSettings settings, IFileSystem fileSystem, IImageService imageService)
{
_settings = settings;
_fileSystem = fileSystem;
_imageService = imageService;
}
I'm just struggling a little to know how to set it up using structuremap and the initialize method, etc. Any help would be appreciated.
Thanks,
Richard.