score:2

Accepted answer

You can use the indexed overload, but you need to use the LINQ to Objects version:

var query = 
    db.Table.Take(10).AsEnumreable()
    .Select((t, index) => index == 0 ? t.Value1 : t.Value2);

score:1

If Table have a primary key. You could do this:

var result= (
        from t in db.Table.Take(10)
        let first=db.Table.Take(10).Select (ta =>ta.PrimayKey).First()
        select new
        {
            Value=(t.PrimaryKey=first?t.Value1 : t.Value2)
        }
    );

Related Articles