C# LINQ: SELECT statement using Lambda Expressions

public static List<Music> GetMusicCollection(){    using (SampleDataContext db = new SampleDataContext(_SampleConnectionString))    {        var musicCollection = db.Musics.Select(u => u);        return musicCollection.ToList<Music>();    }}

public static List<User> GetNextUserFromQueue(){    SampleDataContext db = new SampleDataContext(_SampleConnectionString);    List<User> users = new List<User>();    users.Add((db.Users.Where(u => u.IsPictureSubmitted == false).OrderByDescending(user => user.DateModified).First<User>()));    return users;}

Leave a Reply

Your email address will not be published. Required fields are marked *