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

angular - DownloadURL return null in below code -

meteor - inserting data to database gives error "insert failed: Method '/texts/insert' not found" -