Skip to content

Instantly share code, notes, and snippets.

@stevehorn
Created August 24, 2010 18:23
Show Gist options
  • Save stevehorn/548033 to your computer and use it in GitHub Desktop.
Save stevehorn/548033 to your computer and use it in GitHub Desktop.
<Test()>
public sub Test_getting_by_Type
Dim newTypeInstance As Type = GetType(ModelBinder.ModelBinder(Of Models.Query.Query))
'Fails...why?
Dim retrievedByType = ObjectFactory.GetInstance(newTypeInstance)()
retrievedByType.ShouldNotBeNull()
'Passes
Dim retrievedByExplicit = ObjectFactory.GetInstance(Of ModelBinder.ModelBinder(Of Models.Query.Query))()
retrievedByExplicit.ShouldNotBenull()
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment