json - How do I suppress empty related tables in web api while using entityframework besides projection via a new .Select? -


i have result sets like:

{ "foo": [], "name": "valid" } 

we have use .include clause how prevent "foo" navigation property being returned in web api?

in past, had use projection , create surrogate poco object w/the expected shape via entity framework (i.e.)

.select(c => new { name = c.name }) 

surely in 2017 there's better way?


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -