I'm trying to include relational data with my Company model. When I'm not using Include
, I get my answer but when I'm not including I get Could not get any response
in Postman.
public async Task<IActionResult> Get(string with, string orderBy)
{
CustContext context = new CustContext();
var companies = context.Companies.Include(c => c.Stores).ToListAsync();
return Ok(companies);
}
I want to return the answer in json
format, which it handles by it self when not including.
Someone having a clue of what's not going well?
EDIT
When I'm debugging I see that companies
is set properly together with Stores
. There must be something wrong when returning the result.