I have a plain old CLR object which is essentially a wrapper for two entity framework objects, I\'m doing this so I can pass this wrapper object to a strongly typed view in
Why aren't you using the .AsEnumerable()? In that way, you won't need to create a parameterless constructor and that is what you want.
Your code was almost good. Change it to this:
public IEnumerable ListFoosWithBars(int userID)
{
IEnumerable tempBar = ListBarsByUserID(userID);
IEnumerable results = (from f in _entities.FooSet.AsEnumerable()
join b in tempBar on f.ID equals b.foos.ID
select new FooWrapper(f, b));
return results;
}
I had the same problem today. I had a class with one parameter constructor. This constructor filled a private readonly field which was returned by a property only with a get and not with a set.