Notifications
Announcements
No record found.
Is it common to add if else inside of a switch case? Trying to see if there is a better way!
switch(something)
case(something)
if
else
break;
*This post is locked for comments
msdn.microsoft.com/.../aa842207.aspx
It's definitely possible - it's just a block of code, what you put there is up to you.
Nevertheless if you have a lot of code inside a case, consider extracting it to a separate method. Then the case contains just a method call and it's all easy to read and maintain.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2