I was attempting to retrieve data from the Forms module in code behind. I "invented" this technique because I could not see a way to get the data strongly typed. If there is a way to do this strongly typed it would be far superior to using dynamic. Wanted to get your thoughts on this approach (i.e. using the .NET "dynamic" keyword). Please advise. . . .
var formObjects = App.WorkWith().Forms().Form(
Email = x.FormTextBox_4,
Phone = x.FormTextBox_0,
Name = x.FormTextBox_1,
Address = x.FormTextBox_2,
LatLong = x.FormTextBox_3
On line 1, using the fluent api I get an IQueryable of FormEntry objects. Then I convert it to an Array to execute it against the DB and return an IEnumerable of FormEntry. Then I convert it to dynamic, then project it into my new type (Location is a real class I created, with a bunch of string properties). I was able to figure out the column names (i.e. FormTextBox_XX) by looking at the csv export that sitefinity generates on the "Responses" screen in the back end.
Is there a strongly typed way to do this? If not what are your thoughts on my use of dynamic to retrieve this data?