Problem: No parameterless constructor defined for this object

Feb 10, 2010 at 12:37 AM

It seems that to use the IQueryable works fine when hooked to a datasource object.  But when you are using something like:

    IQueryable<Song> songs = songsContext.Songs;
    foreach (Song song in songs)
        String songTitle = song.SongTitle;

The foreach fails with the error listed above.  This is also true if you are using the List<Song> songList = songs.ToList();

Interestingly these work as long as there is only ONE item returned in your result set.  However it probably isn't much use that way.

Here is the fix:
In your xxxxDataModel.cs add a new constructor such as:

/// <summary>
/// The empty parameter constructor exists ONLY for results queries.
/// </summary>
public ProfileDataModel() {}

I will be updating the Component with this fix in the next release.