Anonymous types and VB.Net

May 8, 2011 at 6:33 PM

I have tried Clay with VB.Net and it works for the most part. But I can not pass in an anonymous type. I can replicate this in C# by doing this.

dynamic c = new ClayFactory();
var x = new[] { 1, 2, 3 };
var plant = c.Plant(ref x);
Console.WriteLine(plant.Length);

The ref keyword is the key here. If the above would work than it would also work in VB.Net.

I made a few blogpost about this.

http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/MSAccess/AccessFormsReports/the-mystery-of-clay-and-1

http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/the-mystery-of-clay-and

http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/using-clay-in-vb-net