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
Post a Comment