1
Answer

Multiple if else in linq select property

Photo of Ami Kar

Ami Kar

4y
3k
1
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. })

Answers (1)