c# - How to order by date from new to oldest? -


i'm having trouble sorting list of dates newest oldest. ideas?

my code follow:

        public async task<iactionresult> prices()     {         var allresults = result in _context.reviews                          orderby result.date descending                          select result;          return view(await allresults.tolistasync());      } 

i receive following error message:

cs1061 'dbset' not contain definition 'orderbydescending' , no extension method 'orderbydescending' accepting first argument of type 'dbset' found (are missing using directive or assembly reference?)

add using system.linq;

that solve problem.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -