Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Entity Framework 101
Message
De
04/06/2014 10:28:03
 
 
À
04/06/2014 10:19:17
Information générale
Forum:
ASP.NET
Catégorie:
Entity Framework
Versions des environnements
Environment:
C# 4.0
OS:
Windows 8
Network:
Windows 2000 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01601183
Message ID:
01601266
Vues:
30
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform