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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -