Skip to content

Instantly share code, notes, and snippets.

@renatogroffe
Created September 17, 2024 17:08
Show Gist options
  • Save renatogroffe/ca75f6332a2fe0b5ef1cf4d8c2377840 to your computer and use it in GitHub Desktop.
Save renatogroffe/ca75f6332a2fe0b5ef1cf4d8c2377840 to your computer and use it in GitHub Desktop.
using ConsoleAppPartialProperty.Helpers;
using System.Runtime.InteropServices;
Console.WriteLine("***** Testes com .NET 9 + C# 13 | Partial Property *****");
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation
.FrameworkDescription} - Ambiente: {Environment.MachineName} - Kernel: {Environment
.OSVersion.VersionString}");
Console.WriteLine();
var selectedDatabases = new string[] { "sqlserver", "mongodb", "postgres", "redis", "mysql" };
foreach (var opcao in selectedDatabases)
{
var oldColor = Console.ForegroundColor;
if (ValidationHelpers.IsRelationalDatabase.IsMatch(opcao))
{
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine($"{opcao} = alternativa valida");
}
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine($"{opcao} = alternativa invalida");
}
Console.ForegroundColor = oldColor;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment