Multiple if else in linq select property
If family income is less then 20k then 10% discount , if income is less than 35k then 5 % discount above 35k no discount.
var students= context.Students.Select
(x=>new{
Income=x.parent.Income,
Discount=x.parent.Income<20k?10:what to write here.
})
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Sachin SinghRank #66 · 26.2K reputationPosted Jan 31, 2021, 11:57 PM EST