FrankM
unread,Aug 8, 2008, 2:00:44 PM8/8/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to structuremap-users
Hi there,
Maybe this question sounds weird, that's because I just started to
play structuremap since yesterday.Here is my problem,
My Repository class:
public interface : IRepository<T> { (...) }
public class UserDTO {(...) }
public class UserRepository : IRepository<UserDTO>
{ ...
}
The config file can handle this without problem.
<DefaultInstance
PluginType="MyDemo.IRepository`1, MyDemo"
PluggedType="MyDemo.UserRepository , MyDemo"
/>
But after adding a second repository class using the same pattern.
say,
public class ItemDTO {(...) }
public class ItemRepository : IRepository<ItemDTO>
{ ...
}
I got all kind of errors then, how to add this into the config file,
IRepository`2? or different syntax other than DefaultInstance?
I tried adding
StructureMapConfiguration
.ForRequestedType<IRepository<OrganizationDTO>>().TheDefaultIsConcreteType<OrganizationRepository>();
into my code and it works OK but I do want to keep all those wrapping
work into xml file.
Any feedback will be appreciated. Thanks.