February 12, 2008 14:07 by
admin
Denny.NET has a post describing how to generate a SQL case statement in LINQ to SQL. His example is:
var gimmeh_gimmeh =
from t in db.sc_Timeslots
where (t.starttime.Minute % 5 == 0) || (t.starttime.Minute % 10 == 0)
select new
{
t.id,
t.starttime,
interval = (t.starttime.Minute % 5 == 0) ? "5 Minutes" : "10 Minutes"
};
Currently rated 5.0 by 1 people
- Currently 5/5 Stars.
- 1
- 2
- 3
- 4
- 5