At the moment, if the media type formatter receives an IQueryable, it will do a foreach over them inside of SerializeMany, which will synchronously run the query. We should probably do a ToArrayAsync() to fix this. We could either do this inside WriteToStreamAsync(), or add another action filter that transforms an IQueryable into an array. I actually have a filter that does the latter inside my project which I could port over. The drawback is that it's Yet Another action filter the user has to add.
At the moment, if the media type formatter receives an IQueryable, it will do a foreach over them inside of SerializeMany, which will synchronously run the query. We should probably do a ToArrayAsync() to fix this. We could either do this inside WriteToStreamAsync(), or add another action filter that transforms an IQueryable into an array. I actually have a filter that does the latter inside my project which I could port over. The drawback is that it's Yet Another action filter the user has to add.