This file contains hidden or 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; | |
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>)}"); |
This file contains hidden or 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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net10.0</TargetFramework> | |
<ImplicitUsings>enable</ImplicitUsings> | |
<Nullable>enable</Nullable> | |
<LangVersion>preview</LangVersion> | |
</PropertyGroup> |
This file contains hidden or 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.Text.Json; | |
var builder = WebApplication.CreateBuilder(args); | |
builder.Services.AddOpenApi(); | |
var app = builder.Build(); | |
if (app.Environment.IsDevelopment()) | |
{ |
This file contains hidden or 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
<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" /> |
This file contains hidden or 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
# 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}"); |
This file contains hidden or 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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net10.0</TargetFramework> | |
<ImplicitUsings>enable</ImplicitUsings> | |
<Nullable>enable</Nullable> | |
<LangVersion>preview</LangVersion> | |
</PropertyGroup> |
This file contains hidden or 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 ConsoleAppNullConditionalAssignment.Models; | |
public class Produto | |
{ | |
public string? Id { get; set; } | |
public string? Nome { get; set; } | |
public double? Preco { get; set; } | |
} |
This file contains hidden or 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.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(); |
This file contains hidden or 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.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(); |
This file contains hidden or 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.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(); |
NewerOlder