Newsletter https://okyrylchuk.dev
Help for Ukraine http://ko-fi.com/okyrylchuk or http://paypal.me/okyrylchuk
In previous versions, you could not overload the += operator.
C# 14 allows user types to customize the behavior of compound assignment operators in a way that the target of the assignment is modified in-place.
In previous versions, you could not overload the += operator.
C# 14 allows user types to customize the behavior of compound assignment operators in a way that the target of the assignment is modified in-place.
It lets you write a property accessor body without declaring an explicit backing field.
The compiler will replace the field keyword with a backing field.
What do you think about this improvement?
It lets you write a property accessor body without declaring an explicit backing field.
The compiler will replace the field keyword with a backing field.
What do you think about this improvement?
They must include exactly one defining declaration and one implementing declaration.
The implementation declaration of a partial event must include add and remove accessors.
They must include exactly one defining declaration and one implementing declaration.
The implementation declaration of a partial event must include add and remove accessors.
For example, nameof(List<>) returns List.
Previously, you could pass only closed generic types, such as List<int>, to return List.
For example, nameof(List<>) returns List.
Previously, you could pass only closed generic types, such as List<int>, to return List.
Previously, you had to check if the customer was null before assigning the order.
In C# 14, the GetCurrentOrder method is not called if the customer is null.
Previously, you had to check if the customer was null before assigning the order.
In C# 14, the GetCurrentOrder method is not called if the customer is null.
There is a new extension keyword that lets you define extension blocks for extension properties, methods, and operators
This means you can group related extension members, enhancing code readability and maintainability
Do you like the new feature?
There is a new extension keyword that lets you define extension blocks for extension properties, methods, and operators
This means you can group related extension members, enhancing code readability and maintainability
Do you like the new feature?
I’m looking forward to another exciting year in the MVP program, continuing to learn, share, and grow with this amazing community.
I’m looking forward to another exciting year in the MVP program, continuing to learn, share, and grow with this amazing community.
Previously, you had to check if the customer was null before assigning the order.
In C# 14, the GetCurrentOrder method is not called if the customer is null.
Previously, you had to check if the customer was null before assigning the order.
In C# 14, the GetCurrentOrder method is not called if the customer is null.
For example, nameof(List<>) returns List.
Previously, you could pass only closed generic types, such as List<int>, to return List.
For example, nameof(List<>) returns List.
Previously, you could pass only closed generic types, such as List<int>, to return List.
ASP NET Core 9 removes Swashbuckle from the template.
However, the .NET team added support for OpenAPI document generation.
The AddOpenApi method registers the required dependencies.
ASP NET Core 9 removes Swashbuckle from the template.
However, the .NET team added support for OpenAPI document generation.
The AddOpenApi method registers the required dependencies.
It lets you write a property accessor body without declaring an explicit backing field.
The compiler will replace the field keyword with a backing field.
What do you think about this improvement?
It lets you write a property accessor body without declaring an explicit backing field.
The compiler will replace the field keyword with a backing field.
What do you think about this improvement?
Entity Framework Core is one of the most popular ORMs in the .NET ecosystem, for good reason. It abstracts away the complexity of working with databases, allowing developers to focus on business logic rather than SQL queries.
Entity Framework Core is one of the most popular ORMs in the .NET ecosystem, for good reason. It abstracts away the complexity of working with databases, allowing developers to focus on business logic rather than SQL queries.
You can control the behavior with the new RespectRequiredConstructorParameters JSON serialization option.
If it's true, the serializer throws the JsonException for missing required properties.
You can control the behavior with the new RespectRequiredConstructorParameters JSON serialization option.
If it's true, the serializer throws the JsonException for missing required properties.
The short answer is that as soon as your API is consumed by more than just yourself.
This Friday, I'll show you how to manage API Versioning Like A Pro in ASP NET Core.
Don’t miss out! Subscribe now! The link is in the comments.
The short answer is that as soon as your API is consumed by more than just yourself.
This Friday, I'll show you how to manage API Versioning Like A Pro in ASP NET Core.
Don’t miss out! Subscribe now! The link is in the comments.
Check my post to learn how easily to fan out HTTP requests in .NET. Link in the comments.
Check my post to learn how easily to fan out HTTP requests in .NET. Link in the comments.
It allows for calculating the frequency of a key.
This improvement looks nice.
What do you think?
It allows for calculating the frequency of a key.
This improvement looks nice.
What do you think?
It makes GUID sequential, which makes it more suitable for relationship databases.
Also, GUID gets the Version property to check the version of the created GUID.
It makes GUID sequential, which makes it more suitable for relationship databases.
Also, GUID gets the Version property to check the version of the created GUID.
There are several ways to do it:
1. Classic way
2. List.Count way
3. Enumerable.Any way
4. Pattern matching way
Which one do you prefer — or do you use a different approach?
Let me know in the comments! 👇
There are several ways to do it:
1. Classic way
2. List.Count way
3. Enumerable.Any way
4. Pattern matching way
Which one do you prefer — or do you use a different approach?
Let me know in the comments! 👇
You can pass the TimeProvider to the Task.Delay method since .NET 8.
The TimeProvider will interpret the delay.
You can use FakeTimeProvider to control the delay in tests.
You can pass the TimeProvider to the Task.Delay method since .NET 8.
The TimeProvider will interpret the delay.
You can use FakeTimeProvider to control the delay in tests.
Use string.Join method to concatenate elements of a collection into a single string, inserting a specified separator between each element.
✔ More readable — No loops
✔ Better performance — Avoids unnecessary string allocations
✔ Less error-prone — No need to trim the last separator
Use string.Join method to concatenate elements of a collection into a single string, inserting a specified separator between each element.
✔ More readable — No loops
✔ Better performance — Avoids unnecessary string allocations
✔ Less error-prone — No need to trim the last separator
.NET 9 introduces the generic counterpart.
It creates a dictionary where the order of key-value pairs can be maintained.
Have you ever used OrderedDictionary?
.NET 9 introduces the generic counterpart.
It creates a dictionary where the order of key-value pairs can be maintained.
Have you ever used OrderedDictionary?
For years, testing Azure Service Bus locally meant relying on cloud instances, costly workarounds, or incomplete mocks. But not anymore!
For years, testing Azure Service Bus locally meant relying on cloud instances, costly workarounds, or incomplete mocks. But not anymore!
For instance, automated systems check the Health endpoint, so recording metrics for it is not particularly helpful.
For instance, automated systems check the Health endpoint, so recording metrics for it is not particularly helpful.
The Type pattern tests the variable to see if it matches a given type.
The Declaration pattern checks if the variable matches the type and assigns the result to a declared variable.
Do you use these patterns?
The Type pattern tests the variable to see if it matches a given type.
The Declaration pattern checks if the variable matches the type and assigns the result to a declared variable.
Do you use these patterns?
A terse way to initialize collections, working with arrays, Span<T>, and more.
The .. spread operator lets you inline collections easily.
Do you like it?
A terse way to initialize collections, working with arrays, Span<T>, and more.
The .. spread operator lets you inline collections easily.
Do you like it?