c# - Has IQueryable provider to preserve order? -
i want create custom iqueryable
provider.
has iqueryable
implementation preserve order of source elements?
for exemple, can (new [] { 1, 2, 3 }).asmyqueriable().select(x => x).toarray()
homecoming 3, 2, 1
?
technically, queryable can whatever feels like. iqueryable
interface, there no constructor , there no contract must follow in regard -- queryable thing can queried via specific methods, , origin state not covered part of interface contract. extension method's documentation, however, should indicate whether order of input sequence retained returned iqueryable
object.
of course, if calls .orderby()
on instance of queryable, expected reorder elements accordingly. but, if developer not phone call .orderby()
free homecoming elements in whatever order like.
c# linq iqueryable
No comments:
Post a Comment