davidhall
unread,Dec 3, 2008, 7:21:56 PM12/3/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, is it possible to override constructor arguments at runtime?
If have the following Constructor definition for one of my windows
forms:
WorksheetEntryForm(IWorksheetService wsService, ITaskService
taskService, int worksheetID)
This allows the form to get the default worksheet for today when the
worksheetID is 0, or get the provided worksheetID
I'm using the following in my bootstrapper class:
ForRequestedType<WorksheetEntryForm>
().TheDefault.Is.OfConcreteType
<WorksheetEntryForm>().WithCtorArg
("worksheetID").EqualTo(0);
Is it possible to override the Constructor Argument injection, so that
my worksheet search form can use StructureMap to constuct an instance
of WorksheetEntryForm but provide it with a worksheetID?
Also, is it possible to change the worksheetID to a nullable int, and
still use constructor injection?
Thanks,
David