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 ConsoleAppIndentationOptions.Models; | |
public class Localidade | |
{ | |
public int Id { get; set; } | |
public string? NomeContinente { get; set; } | |
public string? NomePais { get; set; } | |
public string? NomeCidade { get; set; } | |
} |
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.Runtime.InteropServices; | |
using System.Security.Cryptography; | |
using System.Text.Json; | |
using System.Text; | |
Console.WriteLine("***** Testes com .NET 9 | CryptographicOperations.HashData API *****"); | |
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation | |
.FrameworkDescription} - Ambiente: {Environment.MachineName} - Kernel: {Environment | |
.OSVersion.VersionString}"); |
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 ConsoleAppDefaultWebOptions.Models; | |
using System.Runtime.InteropServices; | |
using System.Text.Json; | |
Console.WriteLine("***** Testes com .NET 9 | Serializacao com Default web options *****"); | |
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation | |
.FrameworkDescription} - Ambiente: {Environment.MachineName} - Kernel: {Environment | |
.OSVersion.VersionString}"); |
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 ConsoleAppDefaultWebOptions.Models; | |
public class Localidade | |
{ | |
public int Id { get; set; } | |
public string? NomeContinente { get; set; } | |
public string? NomePais { get; set; } | |
public string? NomeCidade { get; set; } | |
} |
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 ConsoleAppLinqCountBy.Models; | |
using System.Runtime.InteropServices; | |
Console.WriteLine("***** Testes com .NET 9 | Metodo CountBy - LINQ *****"); | |
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation | |
.FrameworkDescription} - Ambiente: {Environment.MachineName} - Kernel: {Environment | |
.OSVersion.VersionString}"); | |
var localidades = new Localidade[] | |
{ |
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 ConsoleAppLinqCountBy.Models; | |
public class Localidade | |
{ | |
public string? NomeCidade { get; set; } | |
public string? SiglaEstado { get; set; } | |
} |
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
FROM mcr.microsoft.com/dotnet/sdk:8.0.101 AS build-env | |
WORKDIR /app | |
# Copiar csproj e restaurar dependencias | |
COPY *.csproj ./ | |
RUN dotnet restore | |
# Build da aplicacao | |
COPY . ./ | |
RUN dotnet publish -c Release -o out |
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
namespace APIContagem.Middlewares; | |
public static class MiddlewareExecutionNotificatorExtensions | |
{ | |
public static IApplicationBuilder UseMiddlewareExecutionNotificator( | |
this IApplicationBuilder builder) | |
{ | |
return builder.UseMiddleware<MiddlewareExecutionNotificator>(); | |
} | |
} |
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 APIContagem.Middlewares; | |
public class MiddlewareExecutionNotificator | |
{ | |
private readonly RequestDelegate _next; | |
public MiddlewareExecutionNotificator(RequestDelegate next) | |
{ | |
_next = next; | |
} |