Created
October 28, 2025 05:29
-
-
Save donma/4f99be05feaedb112f54c440aff1e1c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var userType = ""; | |
| var result = userType switch | |
| { | |
| var t when string.IsNullOrEmpty(t) => | |
| new Func<string>(() => { Console.WriteLine("Default"); return "CALL_DEFAULT"; })(), | |
| "PLUS" => | |
| new Func<string>(() => { Console.WriteLine("Plus"); return "CALL_PLUS"; })(), | |
| "PREMIUM" => | |
| new Func<string>(() => { Console.WriteLine("Premium"); return "CALL_PREMIUM"; })(), | |
| "Ultimate" => | |
| new Func<string>(() => { Console.WriteLine("Ultimate"); return "CALL_ULTIMATE"; })(), | |
| _ => | |
| new Func<string>(() => { Console.WriteLine("Default"); return "CALL_DEFAULT"; })(), | |
| }; | |
| Console.WriteLine(result); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment