Ok so this might not be the best title but I am struggling with how to title this. Here is what I have thus far:
I currently have data mappers for my objects. I define them in a registry like so. This allows me to get the type name of the object and combine that with the word Mapper and request it. Here is the code I am using:
this.For<ICategoryMapper>()
.Use<CategoryMapper>()
.Named("CategoryMapper");
But now I am having a problem getting the instance from StructureMap in a form that I can use. Because I can't request it like normal with code like this:
ObjectFactory.GetNamedInstance<T>(namedInstance);
The reason being that I don't really know the type. I just know that it should be DomainType name plus the word mapper. There is probably a better way to achieve this but I am at a lost at what to do.
Any input into a better way to achieve this or fix the problem I am having would be great.