-
-
Save configureappio/7cb3c72a026689c79676a7d497042039 to your computer and use it in GitHub Desktop.
KelvinMapperLookup.cs
This file contains 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
services.AddSingleton<KelvinConverterMapper>(provider => key => | |
{ | |
switch ((string.IsNullOrEmpty(key) ? " " : key).ToUpper()[0]) | |
{ | |
case 'C': | |
return provider.GetRequiredService<CentigradeToKelvinMapper>(); | |
case 'F': | |
return provider.GetRequiredService<FahrenheitToKelvinMapper>(); | |
case 'R': | |
return provider.GetRequiredService<RankineToKelvinMapper>(); | |
case 'K': | |
return provider.GetRequiredService<KelvinToKelvinMapper>(); | |
default: | |
return null; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment