Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Entity Framework 101
Message
From
04/06/2014 10:28:03
 
 
To
04/06/2014 10:19:17
General information
Forum:
ASP.NET
Category:
Entity Framework
Environment versions
Environment:
C# 4.0
OS:
Windows 8
Network:
Windows 2000 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01601183
Message ID:
01601266
Views:
29
OK, still trying to get the hang of all these new things I'm learning at once.

So in my RouteController I have this:
        // GET api/Route
        public IEnumerable<Route> GetRoutes()
        {
            return db.Routes.AsEnumerable();
        }
This is where I need to add in the code to sort the routes?

This is what I've tried for the sorting and it looks like it works:
        public IEnumerable<Route> GetRoutes()
        {
            var routes = db.Routes.OrderBy(r => r.rte_name);
            return routes.AsEnumerable();
            //return db.Routes.AsEnumerable();
        }
Thanks
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform