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
Try a different initialization:
public class FooWrapper
{
public FooWrapper() { }
public Foo FooObject { get; set; }
public Bar BarObject { get; set; }
}
public IEnumerable ListFoosWithBars(int userID)
{
IEnumerable tempBar = ListBarsByUserID(userID);
IEnumerable results = (
from f in _entities.FooSet
join b in tempBar on f.ID equals b.foos.ID
select new FooWrapper
{
FooObject = f,
BarObject = b
});
return results;
}