I'm in the process of trying to hook StructureMap in to an existing webforms application. Since it's webforms I have to use Setter Injection, which is not ideal, but it's better than nothing.
Where I'm coming unstuck is translating to VB (I'm really a C# dev currently working in a VB shop). I've written a custom scanner, which works fine in C#, but I'm completely stuck on how to go about translating it into VB.
the original C# looks like this:
public void Process(Type type, PluginGraph graph)
{
if (type.IsInterface)
{
graph.Configure(x => x.SetAllProperties(
y => y.TypeMatches(
z => z == type)));
}
}
The closest I can get in VB is this:
Public Sub Process(ByVal type As Type, ByVal graph As PluginGraph) Implements ITypeScanner.Process
If type.IsInterface Then
graph.Configure(Function(x) _
x.SetAllProperties(Function(y) _
y.TypeMatches(Function(z) _
return z Is type _
) _
) _
)
End If
End Sub
I was hoping that reflector would be able to help me out, but that comes up with code that is similar to mine, which also wont compile.
So, what's the translation?