I have 2 POCO classes -- Contact and TrainingSeminar -- that joined in a many-to-many relationship using EF5
In the Contacts odata controller, I want to be able to return the TrainingSeminars that a contact is registered for...so I have the following controller method
public IQueryable<TrainingSeminar> GetTrainingSeminars([FromODataUri] int key)
{
var contact = _context.Contacts.Find(key);
var seminars = contact.TrainingSeminars.ToList();
return seminars as IQueryable<TrainingSeminar>;
}
When I debug in Visual Studio, the return object "seminars" has 2 items but I get the following error in Fiddler:
"The 'ObjectContent`1' type failed to serialize the response body for content type 'application/json...."message":"Cannot serialize a null 'feed'