EdsonF
EdsonF

Reputation: 2818

Breeze API Controller - The 'ObjectContent`1' type failed to serialize the response body for content type

I am getting this error when attempting to call the

public object Lookups() {

  var divisions = _contextProvider.Context.Divisions;                      

  return divisions;
}

on the Breeze API controller.

The ObjectContent`1' type failed to serialize the response body for content type

What I'm I doing wrong ?

Upvotes: 0

Views: 303

Answers (1)

nate_d
nate_d

Reputation: 21

Return an object, not an IQueryable.

public object Lookups() {

  var divisions = _contextProvider.Context.Divisions;                      

  return new { divisions };
}

Upvotes: 1

Related Questions