I have written an sql qyery like
SELECT TOP 1000
[tlotWeight]
,[TEU]
,[SeaAirFlag]
,CASE
WHEN [SeaAirFlag]='SEA' OR [SeaAirFlag]='Sea'
then [TEU]
else [tlotWeight] end as Volume
FROM [LogisticsBI].[dbo].[GoldenVolume]
I want it to convert it to linq c# query,I have tried something like this
(from t in db.GoldenVolumes
select new { Volume=(t.SeaAirFlag=="SEA"|| t.SeaAirFlag=="Sea")?t.TEU: t.tlotWeight)}
).Take(10000).Distinct()
but its showing some syntax error in linqpad Please help me to correct way in linq to write this query