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
using APIContagem; | |
using APIContagem.Middlewares; | |
using APIContagem.Models; | |
var builder = WebApplication.CreateBuilder(args); | |
builder.Services.AddEndpointsApiExplorer(); | |
builder.Services.AddSwaggerGen(); | |
builder.Services.AddSingleton<Contador>(); |
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
using APIContagem; | |
using APIContagem.Middlewares; | |
using APIContagem.Models; | |
var builder = WebApplication.CreateBuilder(args); | |
builder.Services.AddEndpointsApiExplorer(); | |
builder.Services.AddSwaggerGen(); | |
builder.Services.AddSingleton<Contador>(); |
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
using ConsoleAppRefReadOnly; | |
using System.Runtime.InteropServices; | |
Console.WriteLine("***** Testes com C# 12 | ref readonly parameters *****"); | |
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation | |
.FrameworkDescription} - Ambiente: {Environment.MachineName}- Kernel: {Environment | |
.OSVersion.VersionString}"); | |
Console.WriteLine(); | |
int numero = 0; |
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
namespace ConsoleAppRefReadOnly; | |
public class Fatorial | |
{ | |
public static int Calcular(ref readonly int numero) | |
{ | |
int resultado = 1; | |
for (int i = numero; i > 1; i--) | |
resultado *= i; |
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
namespace ConsoleAppRefReadOnly; | |
public class Fatorial | |
{ | |
public static int Calcular(in int numero) | |
{ | |
int resultado = 1; | |
for (int i = numero; i > 1; i--) | |
resultado *= i; | |
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
Live | Views Canal .NET | Views Coding Night | Temas abordados | |
---|---|---|---|---|
15/11/2023 | 2778 | 279 | .NET 8 + C# 12 + Injeção de Dependências + ASP.NET Core | |
16/11/2023 | 1090 | 159 | .NET 8 + C# 12 + ASP.NET Core | |
17/11/2023 | 1006 | 136 | Blazor + .NET 8 + C# 12 + ASP.NET Core | |
19/11/2023 | 754 | 145 | Aspire + .NET 8 + C# 12 + ASP.NET Core | |
20/11/2023 | 827 | 179 | MAUI + .NET 8 + ASP.NET Core |
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
using ConsoleAppExperimentalAttribute.Helpers; | |
using System.Runtime.InteropServices; | |
Console.WriteLine("***** Testes com C# 12 | ExperimentalAttribute *****"); | |
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation | |
.FrameworkDescription} - Ambiente: {Environment.MachineName}- Kernel: {Environment | |
.OSVersion.VersionString}"); | |
Console.WriteLine(); | |
#pragma warning disable MessageHelper01 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. |
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
using ConsoleAppExperimentalAttribute.Helpers; | |
using System.Runtime.InteropServices; | |
Console.WriteLine("***** Testes com C# 12 | ExperimentalAttribute *****"); | |
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation | |
.FrameworkDescription} - Ambiente: {Environment.MachineName}- Kernel: {Environment | |
.OSVersion.VersionString}"); | |
Console.WriteLine(); | |
MessageHelper.ShowCurrentDateTime(); |
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
using System.Diagnostics.CodeAnalysis; | |
namespace ConsoleAppExperimentalAttribute.Helpers; | |
public static class MessageHelper | |
{ | |
[Experimental(diagnosticId: "MessageHelper01")] | |
public static void ShowCurrentDateTime() | |
{ | |
Console.WriteLine($"Executando o metodo experimental " + |
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
Exemplo | link | |
---|---|---|
Teste1 | https://github.com/renatogroffe/ASPNETCore7-MinimalAPIs-ADB2C-HttpFiles_ContagemAcessos |