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 -

Python Tornado package error when running server -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -