I want to pass parameter to linq request ...
public IEnumerable GetPhotos()
{
PhotoDBDataContext db = new PhotoDBDataContext();
var query = from p in db.Photos
orderby p.PhotoId descending
select new { p.Album, p.AlbumId, p.Description, p.Photographer,
p.PhotographerId, p.PhotoId, p.Tags, p.Thumbnail,
p.Url };
return query;
}
the above example uses "orderby p.PhotoId descending", I want to use the parameter instead of p.PhotoId
is it possible ...
source
share