The Linq query "order by" does not work, and I followed all the offers found on your site and on other sites. Any help would be appreciated.
[WebGet] public IQueryable<vw_providercharge_providers> GetChargeProviders(int submitted) { var results = (from p in this.CurrentDataSource.vw_providercharge_providers where p.submitted == submitted orderby p.fullname select p); return results; }
Thanks for your input!
Yes, this is the WebGet method for the WCF data service. I get a 400 error if I do not return the IQueryable type, so I changed your suggestion a bit. Unfortunately, any order is still apparently ignored.
[WebGet] public IQueryable<vw_providercharge_providers> GetChargeProviders(int submitted) { var results = (from p in this.CurrentDataSource.vw_providercharge_providers where p.submitted == submitted orderby p.fullname select p).ToArray(); results.OrderBy(p => p.patientname); return results; }
linq sql-order-by
user680891
source share