Wondering Wondering - 1 month ago 12
C# Question

Lambda Expression of Select * from TableName

I just want to know what's the lambda expression of

Select * from TableName
.
Like in plain LINQ it will be
var res=from s in db.StudentDatas select s
;
here
StudentData
is name of the table.

Thanks.

Answer

The lambda expression isn't needed:

var res = db.StudentDatas;

You could use one but it would be rather pointless:

var res = db.StudentDatas.Select(s => s);