Reputation: 2434
I'm passing parameter enum type nullable to my controller.
and Need to set this parameter to null without using if else condition.
I'm trying like this..
Category? categoryID = CategoryID.HasValue ? CategoryID : null ? CategoryID : CategoryID;
how can i accomplish this? help me.
Upvotes: 0
Views: 480
Reputation: 2434
Got Solution for this.
Category? categoryID = CategoryID.HasValue ? CategoryID : null
Produced the desired result for me.
Upvotes: 1