Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Unassigned: SelectExpandWrapper can't be converted to IQueryable. [1020]

$
0
0
EntitySetController currently returns an IQueryable<T> for its Get() function. When supplying the $select query, it'll throw an ArgumentException stating that it is unable to convert the SelectExpandWrapper to IQueryable.

I suppose the function should be changed to return an IEnumerable instead and set the QueryableAttribute on it.
I also think the functions that return T should be adapted to utilize SingleResult<T>?
Comments: I think you misread what I said; if you use the EntitySetController<TEntity, TKey> class' Get function, which returns an IQueryable<TEntity> and call that function using either $expand and/or $select, it'll throw an ArgumentException. SelectExpandWrapper, which is the object that is created due to using $select or $expand, can't be converted to an IQueryable<TEntity>. For it to work properly, you need to change the function to return IEnumerable<TEntity> instead. (and then, as far as I know, you'll have to now explicitly set the QueryableAttribute which isn't required if the function returns IQueryable)

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>