From 117c4d7ae329d88e3781b3a4b3f26f01d8646ec9 Mon Sep 17 00:00:00 2001 From: Sefer Mirza Date: Tue, 3 Mar 2026 10:12:09 +0300 Subject: [PATCH 1/9] init 'issue/dotnet-10/research' --- dotnet-10-research-notes.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 dotnet-10-research-notes.md diff --git a/dotnet-10-research-notes.md b/dotnet-10-research-notes.md new file mode 100644 index 0000000..04c7210 --- /dev/null +++ b/dotnet-10-research-notes.md @@ -0,0 +1 @@ +# .NET 10 Research Notes \ No newline at end of file From 6da5872f2ad6051a3c582fee85cca03e5626ecb3 Mon Sep 17 00:00:00 2001 From: Sefer Mirza Date: Tue, 3 Mar 2026 13:09:23 +0300 Subject: [PATCH 2/9] add research notes --- dotnet-10-research-notes.md | 65 ++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/dotnet-10-research-notes.md b/dotnet-10-research-notes.md index 04c7210..c287b79 100644 --- a/dotnet-10-research-notes.md +++ b/dotnet-10-research-notes.md @@ -1 +1,64 @@ -# .NET 10 Research Notes \ No newline at end of file +# .NET 10 Research Notes + +## Runtime + +[Runtime'daki değişiklikler](https://learn.microsoft.com/tr-tr/dotnet/core/whats-new/dotnet-10/runtime) +doğrudan uygulanıyor. + +## Libraries + +### Numeric ordering for string comparison + +stringlerin sonuna göre sıralama yapıyor. + +```csharp +foreach (string os in new[] { "Windows 11", "Windows 10", "Windows 8" }.Order(numericStringComparer)) +{ + Console.WriteLine(os); +} + +// Output: +// Windows 8 +// Windows 10 +// Windows 11 +``` + +### Serialization + +Bir kaç işimize yarayabilecek serileştirme güncellemesi var ama biz Newtonsoft +kullanıyoruz. + +https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-10/libraries#serialization + +## SDK + +### Support for Microsoft Testing Platform in dotnet test + +dotnet test natively supports Microsoft.Testing.Platform. To enable this +feature, add the following configuration to your global.json file: + +```csharp +{ + "test": { + "runner": "Microsoft.Testing.Platform" + } +} +``` + +[MTP](https://learn.microsoft.com/en-us/dotnet/core/testing/microsoft-testing-platform-intro) + +## ASP.NET + +### Treating empty string in form post as null for nullable value types + +When using the [FromForm] attribute +```csharp +app.MapPost("/todo", ([FromForm] Todo todo) => TypedResults.Ok(todo)); + +... + +public class Todo +{ + public DateOnly? DueDate { get; set; } // Empty strings map to `null` +} +``` \ No newline at end of file From 90575c905349ccd946113b0738da5a0319a7f327 Mon Sep 17 00:00:00 2001 From: Sefer Mirza Date: Tue, 3 Mar 2026 19:14:18 +0300 Subject: [PATCH 3/9] add more research notes --- dotnet-10-research-notes.md | 102 +++++++++++++++++++++++++++++++++++- 1 file changed, 101 insertions(+), 1 deletion(-) diff --git a/dotnet-10-research-notes.md b/dotnet-10-research-notes.md index c287b79..0d54125 100644 --- a/dotnet-10-research-notes.md +++ b/dotnet-10-research-notes.md @@ -61,4 +61,104 @@ public class Todo { public DateOnly? DueDate { get; set; } // Empty strings map to `null` } -``` \ No newline at end of file +``` + +### Validation support in Minimal APIs + +`AddValidation` ile response model'de eklenen attributes'lar ile validasyon yapılabiliyor + +```csharp +app.MapPost("/products", + ([EvenNumber(ErrorMessage = "Product ID must be even")] int productId, [Required] string name) + => TypedResults.Ok(productId)) + .DisableValidation(); +//****** +public record Product( + [Required] string Name, + [Range(1, 1000)] int Quantity); +``` + +### `IProblemDetailsService` + +Defines a type that provide functionality to create a ProblemDetails response. + +Bu 7'den sonra da varmış. Kullanmamışız. Ben yinede ekliyim belki şimdi bazı şeyleri kolaylayabilir. + +https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iproblemdetailsservice?view=aspnetcore-10.0 + +### Validation APIs moved to `Microsoft.Extensions.Validation` + +The validation APIs have moved to the `Microsoft.Extensions.Validation` +namespace and NuGet package. + +### OpenAPI + +#### Response description on ProducesResponseType for API controllers + +The `ProducesAttribute`, `ProducesResponseTypeAttribute`, and +`ProducesDefaultResponseTypeAttribute` now accept an optional string parameter, +`Description`, that sets the description of the response: + +```C# +[HttpGet(Name = "GetWeatherForecast")] +[ProducesResponseType>(StatusCodes.Status200OK, + Description = "The weather forecast for the next 5 days.")] +public IEnumerable Get() +{ +``` + +#### Support for `IOpenApiDocumentProvider` in the DI container + +bu servis OpenAPI dokümanını kod içinden programatik olarak alabilmeyi sağlıyor + +#### Use HTTP Method Object Instead of Enum + +```csharp +// Before (1.6) +OpenApiOperation operation = new OpenApiOperation +{ + HttpMethod = OperationType.Get +}; + +// After (2.0) +OpenApiOperation operation = new OpenApiOperation +{ + HttpMethod = new HttpMethod("GET") // or HttpMethod.Get +}; +``` + +[daha fazla 2.0 değişikliği için](https://github.com/microsoft/OpenAPI.NET/blob/main/docs/upgrade-guide-2.md) + +### Authenticatio and authorization + +#### Avoid cookie login redirects for known API endpoints + +sanırım bu bizi ilgilendirmiyor biz login e redirect etmiyoruz zaten ama yapılan +şeyi yinede yazayım: +Artık bilinen API endpoint'lerine yapılan yetkisiz istekler login sayfasına +yönlendirme yerine doğrudan 401 ve 403 döndürüyor. + +### Diğerleri + +#### Support for the .localhost Top-Level Domain + +```json +{ + "profiles": { + "https": { + "applicationUrl": "https://myapp.dev.localhost:7099;http://myapp.dev.localhost:5036" + } + } +} +``` + +> [!NOTE] +> +> After installing .NET 10 SDK Preview 7, trust the new developer certificate by +> running dotnet dev-certs https --trust at the command line to ensure your +> system is configured to trust the new certificate. + +#### Detect if URL is local using `RedirectHttpResult.IsLocalUrl` + +`RedirectHttpResult.IsLocalUrl` diye bir helper gelmiş. url veriyorsun oradaki +redirecturl locale e mi gidecek diye bakıyor. locale se true dönüyor. \ No newline at end of file From 775297209d2aa45bc2541f4aa9004254fff4eb9a Mon Sep 17 00:00:00 2001 From: Sefer Mirza Date: Tue, 3 Mar 2026 19:51:51 +0300 Subject: [PATCH 4/9] add last update notes --- dotnet-10-research-notes.md | 99 ++++++++++++++++++++++++++++++++++++- 1 file changed, 98 insertions(+), 1 deletion(-) diff --git a/dotnet-10-research-notes.md b/dotnet-10-research-notes.md index 0d54125..ee9a985 100644 --- a/dotnet-10-research-notes.md +++ b/dotnet-10-research-notes.md @@ -161,4 +161,101 @@ yönlendirme yerine doğrudan 401 ve 403 döndürüyor. #### Detect if URL is local using `RedirectHttpResult.IsLocalUrl` `RedirectHttpResult.IsLocalUrl` diye bir helper gelmiş. url veriyorsun oradaki -redirecturl locale e mi gidecek diye bakıyor. locale se true dönüyor. \ No newline at end of file +redirecturl locale e mi gidecek diye bakıyor. locale se true dönüyor. + +## C# 14 + +### Extension members + +yeni extension yazma yöntemleri geldi + +```csharp +public static class Enumerable +{ + // Extension block + extension(IEnumerable source) // extension members for IEnumerable + { + // Extension property: + public bool IsEmpty => !source.Any(); + + // Extension method: + public IEnumerable Where(Func predicate) { ... } + } + + // extension block, with a receiver type only + extension(IEnumerable) // static extension members for IEnumerable + { + // static extension method: + public static IEnumerable Combine(IEnumerable first, IEnumerable second) { ... } + + // static extension property: + public static IEnumerable Identity => Enumerable.Empty(); + + // static user defined operator: + public static IEnumerable operator + (IEnumerable left, IEnumerable right) => left.Concat(right); + } +} +``` + +### `field` + +artık field tanımlamaya gerek yok + +```csharp +public string Name +{ + get; + set => field = value ?? throw new ArgumentNullException(nameof(value)); +} +``` + +### Implicit Span Conversions + +Span ve ReadOnlySpan için, ReadOnlySpan, Span ve T[] türlerine +implicit cast gelmiş + +```csharp +int[] array = new[] { 1, 2, 3 }; +ReadOnlySpan ros = array; + +void Process(ReadOnlySpan data) { } +Process(array); +``` + +### `nameof` Unbound Generic Types + +aşağıdaki işlemlere izin veriliyormuş + +```csharp +nameof(List<>) +nameof(Dictionary<,>) +``` + +### Simple lambda parameters with modifiers + +scoped, ref, in, out, or ref readonly gibi lambda expression parametrelerinde +type belirtme biraz daha hafiflemiş. bunlarda analyzerlar önerileri veriyor zaten + +```csharp +TryParse parse2 = (string text, out int result) => Int32.TryParse(text, out result); +``` + +### partial members + +artık instance constructors ve events partial olabiliyormuş + +### User-Defined Compound Assignment + +sanırım eskiden +=, -=, *= gibi operatorleri kendin yazamıyordun. artık +yazılabiliyor gibi + +tam olarak hangilerine izin var tam anlamadım https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-14.0/user-defined-compound-assignment +### Null-Conditional Assignment + +atamalarda if ile not null kontrolüne gerek kalmamış + +```csharp +customer?.Order = GetCurrentOrder(); +``` + +ama +=, -= falan desteklemiyor \ No newline at end of file From d227384e045d040759021e5d2859dbc4312d8d06 Mon Sep 17 00:00:00 2001 From: Sefer Mirza Date: Tue, 3 Mar 2026 21:00:39 +0300 Subject: [PATCH 5/9] add new task --- dotnet-10-research-notes.md | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/dotnet-10-research-notes.md b/dotnet-10-research-notes.md index ee9a985..fa5b60a 100644 --- a/dotnet-10-research-notes.md +++ b/dotnet-10-research-notes.md @@ -1,10 +1,5 @@ # .NET 10 Research Notes -## Runtime - -[Runtime'daki değişiklikler](https://learn.microsoft.com/tr-tr/dotnet/core/whats-new/dotnet-10/runtime) -doğrudan uygulanıyor. - ## Libraries ### Numeric ordering for string comparison @@ -12,6 +7,8 @@ doğrudan uygulanıyor. stringlerin sonuna göre sıralama yapıyor. ```csharp +StringComparer numericStringComparer = StringComparer.Create(CultureInfo.CurrentCulture, CompareOptions.NumericOrdering); + foreach (string os in new[] { "Windows 11", "Windows 10", "Windows 8" }.Order(numericStringComparer)) { Console.WriteLine(os); @@ -23,14 +20,14 @@ foreach (string os in new[] { "Windows 11", "Windows 10", "Windows 8" }.Order(nu // Windows 11 ``` -### Serialization +This option isn't valid for the following index-based string operations: +IndexOf, LastIndexOf, StartsWith, EndsWith, IsPrefix, and IsSuffix. -Bir kaç işimize yarayabilecek serileştirme güncellemesi var ama biz Newtonsoft -kullanıyoruz. +## SDK -https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-10/libraries#serialization +### SLNX file format -## SDK +sln dosyaları slnx olacak ### Support for Microsoft Testing Platform in dotnet test @@ -79,7 +76,7 @@ public record Product( ``` ### `IProblemDetailsService` - +bir örnek yap Defines a type that provide functionality to create a ProblemDetails response. Bu 7'den sonra da varmış. Kullanmamışız. Ben yinede ekliyim belki şimdi bazı şeyleri kolaylayabilir. @@ -129,7 +126,7 @@ OpenApiOperation operation = new OpenApiOperation [daha fazla 2.0 değişikliği için](https://github.com/microsoft/OpenAPI.NET/blob/main/docs/upgrade-guide-2.md) -### Authenticatio and authorization +### Authentication and authorization #### Avoid cookie login redirects for known API endpoints @@ -168,7 +165,7 @@ redirecturl locale e mi gidecek diye bakıyor. locale se true dönüyor. ### Extension members yeni extension yazma yöntemleri geldi - +bu syntax a geçilecek ```csharp public static class Enumerable { @@ -250,6 +247,7 @@ sanırım eskiden +=, -=, *= gibi operatorleri kendin yazamıyordun. artık yazılabiliyor gibi tam olarak hangilerine izin var tam anlamadım https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-14.0/user-defined-compound-assignment + ### Null-Conditional Assignment atamalarda if ile not null kontrolüne gerek kalmamış From 79d0b008c3cf01c860fd1fbb86fec793fb118abe Mon Sep 17 00:00:00 2001 From: Sefer Mirza Date: Wed, 4 Mar 2026 15:49:29 +0300 Subject: [PATCH 6/9] add migration notes --- dotnet-10-research-notes.md | 59 +++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/dotnet-10-research-notes.md b/dotnet-10-research-notes.md index fa5b60a..0966d7b 100644 --- a/dotnet-10-research-notes.md +++ b/dotnet-10-research-notes.md @@ -23,6 +23,21 @@ foreach (string os in new[] { "Windows 11", "Windows 10", "Windows 8" }.Order(nu This option isn't valid for the following index-based string operations: IndexOf, LastIndexOf, StartsWith, EndsWith, IsPrefix, and IsSuffix. +#### AsyncEnumerable + +The [AsyncEnumerable](https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable) class in .NET 10, and in the [`System.Linq.AsyncEnumerable` NuGet package](https://www.nuget.org/packages/System.Linq.AsyncEnumerable/), provides LINQ support for [IAsyncEnumerable<T>](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.iasyncenumerable-1). + +## Networking + +### Streaming HTTP responses enabled by default in browser HTTP clients + +The [HttpContent](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpcontent) no longer contains a [MemoryStream](https://learn.microsoft.com/en-us/dotnet/api/system.io.memorystream). Instead, [HttpContent.ReadAsStreamAsync](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpcontent.readasstreamasync) returns a `BrowserHttpReadStream`, which does not support synchronous operations. + +```csharp +var response = await httpClient.GetAsync("https://example.com"); +var contentStream = await response.Content.ReadAsStreamAsync(); // Returns BrowserHttpReadStream instead of MemoryStream +``` + ## SDK ### SLNX file format @@ -44,11 +59,44 @@ feature, add the following configuration to your global.json file: [MTP](https://learn.microsoft.com/en-us/dotnet/core/testing/microsoft-testing-platform-intro) +### .NET CLI `--interactive` defaults to `true` in user scenarios + +bu interactive default olarak true yapılmış. `dotnet restore` tarafında bir sorun çıkarsa +bundan kaynaklı olabilir. `--interactive false` şeklinde verilerek tekrar kapatılabilir + +### Code coverage EnableDynamicNativeInstrumentation defaults to false + +büyük ihtimalle bizi etkilemeyecek ama depend edilen kütüphanelerle ilgili problem olursa diye +not olarak ekliyorum. + +coverage collect te EnableDynamicNativeInstrumentation false yapılmış. native araçlardan +coverage almada sorun çıkarıyor bu flag + +### dotnet restore audits transitive packages + +audit warningleri default olarak seviye atlatılmış. bizde warningler error olarak gösterildiğinden +restorelarda sorun yaratabilir. + +```xml + + + + +yada + + + NU1901;NU1902;NU1903;NU1904;$(WarningsNotAsErrors) + +``` + + + ## ASP.NET ### Treating empty string in form post as null for nullable value types When using the [FromForm] attribute + ```csharp app.MapPost("/todo", ([FromForm] Todo todo) => TypedResults.Ok(todo)); @@ -76,6 +124,7 @@ public record Product( ``` ### `IProblemDetailsService` + bir örnek yap Defines a type that provide functionality to create a ProblemDetails response. @@ -160,12 +209,18 @@ yönlendirme yerine doğrudan 401 ve 403 döndürüyor. `RedirectHttpResult.IsLocalUrl` diye bir helper gelmiş. url veriyorsun oradaki redirecturl locale e mi gidecek diye bakıyor. locale se true dönüyor. +#### Exception diagnostics are suppressed when IExceptionHandler.TryHandleAsync returns true + +`IExceptionHandler` ile exception'ları handle ettiğinde(true döndüğünde) artık o exception +için otomatik olarak log ve telemetry yazılmıyor + ## C# 14 ### Extension members yeni extension yazma yöntemleri geldi bu syntax a geçilecek + ```csharp public static class Enumerable { @@ -208,7 +263,7 @@ public string Name ### Implicit Span Conversions -Span ve ReadOnlySpan için, ReadOnlySpan, Span ve T[] türlerine +Span `` ve ReadOnlySpan `` için, ReadOnlySpan ``, Span `` ve T[] türlerine implicit cast gelmiş ```csharp @@ -256,4 +311,4 @@ atamalarda if ile not null kontrolüne gerek kalmamış customer?.Order = GetCurrentOrder(); ``` -ama +=, -= falan desteklemiyor \ No newline at end of file +ama +=, -= falan desteklemiyor From 2c1c1cff5fc77995689623f6033cabd5e79602af Mon Sep 17 00:00:00 2001 From: Sefer Mirza Date: Wed, 4 Mar 2026 18:31:18 +0300 Subject: [PATCH 7/9] add migration tasks --- dotnet-10-research-notes.md | 65 +++++++++++++++++++++++++++++++++---- 1 file changed, 59 insertions(+), 6 deletions(-) diff --git a/dotnet-10-research-notes.md b/dotnet-10-research-notes.md index 0966d7b..1ad5782 100644 --- a/dotnet-10-research-notes.md +++ b/dotnet-10-research-notes.md @@ -1,5 +1,64 @@ # .NET 10 Research Notes +## Learn Tasks + +- [ ] install dotnet 10 +- [ ] upgrade dotnet version to `10` +- [ ] upgrade c# version to `14` +- [ ] make sure packages fine with dotnet 10 +- [ ] + +## Migration Tasks + +> [!INFO] This task are temp + +- [ ] install dotnet 10 +- [ ] upgrade dotnet version to `10` +- [ ] upgrade c# version to `14` +- [ ] make sure packages fine with dotnet 10 +- Opportunistic Improvements + - [ ] Use `CompareOptions.NumericOrdering` property of the `StringComparer` + object if it will make things easier + - [ ] At first glance, it didn't seem necessary, but if needed, it looks like + description support has been added to `ProducesAttribute`, + `ProducesResponseTypeAttribute`, and `ProducesDefaultResponseTypeAttribute` + - [ ] Use `RedirectHttpResult.IsLocalUrl` in places that check whether the URL + redirects to the locale or externally + - [ ] Use if necessary, the `field` keyword in properties + - [ ] Now allows `nameof` for unbound generics. If there were different + approaches previously because it wasn't allowed, these can be simplified + - [ ] The partial constructor feature now supported. Use it if we need to + - probably, the analyzer will already warn you, but just in case; + - [ ] use implicit `Span` conversions to array + - [ ] use simple lambda parameters with modifiers + - [ ] use Null-Conditional assignment + - do if okay after learn + - [ ] if it is really necessary, use the validation attributes in response + records + - [ ] if necessary, edit the response of unhandled errors with + `IProblemDetailsService` +- Required Migrations + - [ ] use `.slnx` instead of `.sln` + - [ ] use extension members + - Property extensions will be used for those that do not take parameters and + for specifying layer builders. exp: `configure.Ui.ComponentPresets(...)` + - if okay after learn + - [ ] use `Microsoft Testing Platform` for testing +- Troubleshooting & Pitfalls(You should also test the tasks that can be checked + to be sure) + - `HttpContent` now returns `BrowserHttpReadStream` instead of `MemoryStream` + - The warning level for audits has been raised in `dotnet restore`. If the + error encountered cannot be resolved, the warning level can be lowered in + `Directory.Build.props` or the relevant warning can be ignored + - Validation APIs moved to `Microsoft.Extensions.Validation` + - If you encounter any issues with OpenAPI, check [here](https://github.com/microsoft/OpenAPI.NET/blob/main/docs/upgrade-guide-2.md) + - [ ] If `dotnet restore` is waiting for user input, it should be set to + `--interactive false` + - [ ] If you encounter an error or receive incorrect results when obtaining + coverage, you may need to set `EnableDynamicNativeInstrumentation` to `true` + - [ ] Now, in form post actions, `nullable` fields are automatically set to + null when they receive an empty string + ## Libraries ### Numeric ordering for string comparison @@ -23,10 +82,6 @@ foreach (string os in new[] { "Windows 11", "Windows 10", "Windows 8" }.Order(nu This option isn't valid for the following index-based string operations: IndexOf, LastIndexOf, StartsWith, EndsWith, IsPrefix, and IsSuffix. -#### AsyncEnumerable - -The [AsyncEnumerable](https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable) class in .NET 10, and in the [`System.Linq.AsyncEnumerable` NuGet package](https://www.nuget.org/packages/System.Linq.AsyncEnumerable/), provides LINQ support for [IAsyncEnumerable<T>](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.iasyncenumerable-1). - ## Networking ### Streaming HTTP responses enabled by default in browser HTTP clients @@ -89,8 +144,6 @@ yada ``` - - ## ASP.NET ### Treating empty string in form post as null for nullable value types From 041c27f010d4237449829d77fc45bccca735a161 Mon Sep 17 00:00:00 2001 From: Sefer Mirza Date: Wed, 4 Mar 2026 18:58:01 +0300 Subject: [PATCH 8/9] edit document --- dotnet-10-research-notes.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/dotnet-10-research-notes.md b/dotnet-10-research-notes.md index 1ad5782..d47bad3 100644 --- a/dotnet-10-research-notes.md +++ b/dotnet-10-research-notes.md @@ -1,13 +1,5 @@ # .NET 10 Research Notes -## Learn Tasks - -- [ ] install dotnet 10 -- [ ] upgrade dotnet version to `10` -- [ ] upgrade c# version to `14` -- [ ] make sure packages fine with dotnet 10 -- [ ] - ## Migration Tasks > [!INFO] This task are temp From be891f31854849baa20680041ab2f82c1d94213b Mon Sep 17 00:00:00 2001 From: Sefer Mirza Date: Wed, 4 Mar 2026 19:03:22 +0300 Subject: [PATCH 9/9] add note --- dotnet-10-research-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/dotnet-10-research-notes.md b/dotnet-10-research-notes.md index d47bad3..afd3a3e 100644 --- a/dotnet-10-research-notes.md +++ b/dotnet-10-research-notes.md @@ -1,3 +1,4 @@ + # .NET 10 Research Notes ## Migration Tasks