IntelliTect / IntelliTect/EssentialCSharp
Improve GetAllValidNETPreprocessorSymbols
- Dominant language
- C#
- Stars
- 418
- Forks
- 173
- Avg merge
- 3m
- Merged PRs (30d)
- 3
Description
This works, but I think it is cleaner, to just write out the individual `yield return` lines.
_Originally posted by @Keboo in https://github.com/IntelliTect/EssentialCSharp/pull/584#discussion_r1383683019_
Maybe something like:
```C#
switch
(
(majorVersion, minorVersion)
)
{
case (5, 0):
yield return "NET5_0_OR_GREATER";
yield return "NET5_0";
goto case (3, 1);
case (3, 1):
yield return "NETCOREAPP3_1_OR_GREATER";
yield return "NETCOREAPP3_1";
goto case (3, 0);
case (3, 0):
yield return "NETCOREAPP3_0_OR_GREATER";
goto case (2, 1);
case (2, 1):
yield return "NETCOREAPP2_1_OR_GREATER";
goto case (2, 0);
case (2, 0):
yield return "NETCOREAPP2_0_OR_GREATER";
goto case (1, 1);
case (1, 1):
yield return "NETCOREAPP1_1_OR_GREATER";
goto case (1, 0);
case (1, 0):
yield return "NETCOREAPP1_0_OR_GREATER";
break;
default:
break;
```
This needs more cleanup and work, but general structure is there
Contributor guide
Assessment
This issue has not been assessed yet.