I usually use linq to sql with an IQueryable or IEnumerable to get data like this:
public static IQueryable getSomething()
{
var getit = from d in database.table select d;
return getit;
}
and it works fine but i am trying to use select new with it like this:
public static IQueryable getSomething()
{
var getit = from d in database.table select new
{
value1 = d.1,
value2 = d.2
};
return getit;
}
this is a sample code and not the actual code.
but that wont work, how do i do this?
thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…