Skip to content

Instantly share code, notes, and snippets.

View renatogroffe's full-sized avatar
🎯
Focusing

Renato Groffe renatogroffe

🎯
Focusing
  • Brazil
  • 07:47 (UTC -03:00)
View GitHub Profile
using System.Runtime.InteropServices;
Console.WriteLine("***** Testes com C# 14 + .NET 10 | Unbound generic support for nameof *****");
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation
.FrameworkDescription} - Ambiente: {Environment.MachineName} - Kernel: {Environment
.OSVersion.VersionString}");
Console.WriteLine();
Console.WriteLine($"nameof(List<object>) = {nameof(List<object>)}");
Console.WriteLine($"nameof(HashSet<int>) = {nameof(HashSet<int>)}");
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
</PropertyGroup>
using System.Text.Json;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddOpenApi();
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0-preview.4.25258.110" />
# pragma warning disable CS8625
using ConsoleAppNullConditionalAssignment.Models;
using System.Runtime.InteropServices;
using System.Text.Json;
Console.WriteLine("***** Testes com .NET 10 | Null-conditional assignment *****");
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation
.FrameworkDescription} - Ambiente: {Environment.MachineName} - Kernel: {Environment
.OSVersion.VersionString}");
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
</PropertyGroup>
namespace ConsoleAppNullConditionalAssignment.Models;
public class Produto
{
public string? Id { get; set; }
public string? Nome { get; set; }
public double? Preco { get; set; }
}
using System.Globalization;
using System.Runtime.InteropServices;
using System.Text.Json;
Console.WriteLine("***** Testes com .NET 10 | Numeric Ordering for String Comparison *****");
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation
.FrameworkDescription} - Ambiente: {Environment.MachineName} - Kernel: {Environment
.OSVersion.VersionString}");
Console.WriteLine();
using System.Globalization;
using System.Runtime.InteropServices;
Console.WriteLine("***** Testes com .NET 10 | Novos overloads na classe estatica ISOWeek *****");
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation
.FrameworkDescription} - Ambiente: {Environment.MachineName} - Kernel: {Environment
.OSVersion.VersionString}");
var currentDate = DateOnly.FromDateTime(DateTime.Now);
Console.WriteLine();
using System.Globalization;
using System.Runtime.InteropServices;
Console.WriteLine("***** Testes com .NET 10 | Novos overloads na classe estatica ISOWeek *****");
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation
.FrameworkDescription} - Ambiente: {Environment.MachineName} - Kernel: {Environment
.OSVersion.VersionString}");
var currentDate = DateOnly.FromDateTime(DateTime.Now);
Console.WriteLine();