Where to insert 'orderby' expression in this linq-to-sql query
Posted
by ile
on Stack Overflow
See other posts from Stack Overflow
or by ile
Published on 2010-03-31T20:54:22Z
Indexed on
2010/03/31
21:03 UTC
Read the original article
Hit count: 421
linq-to-sql
|orderby
var result = db.PhotoAlbums.Select(albums => new PhotoAlbumDisplay
{
AlbumID = albums.AlbumID,
Title = albums.Title,
Date = albums.Date,
PhotoID = albums.Photos.Select(photo => photo.PhotoID).FirstOrDefault().ToString()
});
Wherever I try to put orderby albums.AlbumID descending
I get error. Someone knows solution?
Thanks!
© Stack Overflow or respective owner