Skip to content

Instantly share code, notes, and snippets.

View renatogroffe's full-sized avatar
🎯
Focusing

Renato Groffe renatogroffe

🎯
Focusing
  • Brazil
  • 06:43 (UTC -03:00)
View GitHub Profile
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>preview</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
namespace ConsoleAppFieldKeyword.Models;
public class Temperatura
{
private double _fahrenheit;
public double Fahrenheit
{
get => _fahrenheit;
set

Mermaid-Copilot

Exemplos de diagramas de Mermaid gerados com auxílio do GitHub Copilot.

Exemplo de autenticação via JWT

Dúvida enviada ao Copilot:

Gere um diagrama de sequência para Mermaid (código) detalhando como seria o fluxo de uma aplicação cliente que consome uma API REST protegida por tokens JWT. O token é obtido a partir de um Identity Provider (Microsoft Entra ID, Keycloak) e, uma vez que a aplicação receba esse token, o mesmo é utilizado para se fazer uma chamada a uma API REST protegida.

using System.Diagnostics;
using System.Runtime.InteropServices;
Console.WriteLine("***** Testes com .NET 9 | Melhorias em Debug.Assert *****");
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation
.FrameworkDescription} - Ambiente: {Environment.MachineName} - Kernel: {Environment
.OSVersion.VersionString}");
Console.WriteLine();
Console.WriteLine("Informe um numero inteiro positivo:");
using System.Collections.ObjectModel;
using System.Runtime.InteropServices;
using System.Text.Json;
Console.WriteLine("***** Testes com .NET 9 | O tipo generico ReadOnlySet<T> *****");
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation
.FrameworkDescription} - Ambiente: {Environment.MachineName} - Kernel: {Environment
.OSVersion.VersionString}");
var campeoesMundiais = new HashSet<string>()
using System.Buffers.Text;
using System.Runtime.InteropServices;
using System.Text;
Console.WriteLine("***** Testes com .NET 9 | Encode/Decode com Base64Url *****");
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation
.FrameworkDescription} - Ambiente: {Environment.MachineName} - Kernel: {Environment
.OSVersion.VersionString}");
Console.WriteLine();
using System.Runtime.InteropServices;
Console.WriteLine("***** Testes com .NET 9 | OrderedDictionary<TKey,TValue> *****");
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation
.FrameworkDescription} - Ambiente: {Environment.MachineName} - Kernel: {Environment
.OSVersion.VersionString}");
Console.WriteLine();
OrderedDictionary<string, int> d = new()
using System.Runtime.InteropServices;
using System.Text.Json;
using System.Text.Json.Nodes;
Console.WriteLine("***** Testes com .NET 9 | Manipulando a ordem de itens com JsonObject *****");
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation
.FrameworkDescription} - Ambiente: {Environment.MachineName} - Kernel: {Environment
.OSVersion.VersionString}");
var plataformaDotNet = new JsonObject()
using ConsoleAppJsonSchemaExporter.Models;
using System.Runtime.InteropServices;
using System.Text.Json;
using System.Text.Json.Schema;
Console.WriteLine("***** Testes com .NET 9 | Utilizando JsonSchemaExporter *****");
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation
.FrameworkDescription} - Ambiente: {Environment.MachineName} - Kernel: {Environment
.OSVersion.VersionString}");
namespace ConsoleAppJsonSchemaExporter.Models;
public class TorneioEsportivo
{
public string? Nome { get; set; }
public Edicao[] UltimasEdicoes { get; set; } = new Edicao[6];
}
public class Edicao
{