Exploring the Power of .NET 7: A Developer's Perspective at Elliott
Janvier 27, 2023
In this article, we will delve into the newest version of the .NET framework - .NET 7. As a .Net developer at Elliott, a company that specializes in providing enterprise-level solutions for clients, we have a wealth of experience to draw from in discussing the latest advancements in .NET. We'll start by providing an overview of what .NET 7 is and its key features and improvements. We'll then delve into the performance enhancements, specifically focusing on the introduction of EF7 and its impact on performance compared to previous versions. Additionally, we'll provide real-world examples of improvements in application performance. We'll also discuss the ease of migration from .NET 6, providing tips and best practices for a smooth transition. Furthermore, drawing from our own experience as a .Net developer, we'll share the benefits and challenges faced during implementation of .NET 7 for a banking client in Luxembourg, and evaluate its effectiveness for enterprise-level applications. Finally, we'll conclude with additional resources for further information and references.
So, let's dive into the exciting world of .Net 7! 🚀

Plan
- Introduction
- Overview of .NET 7
- Migration to .NET 7
- Our Experience
- Conclusion
- References
Introduction
The latest version of .NET framework, .NET 7, has been recently released by Microsoft. This cross-platform, open-source software development platform offers a range of enhancements for developers, such as performance improvements, C# language upgrades, and cloud-native, container-based development capabilities. In this article, we will explore the key features and improvements of .NET 7, the ease of migration process from .NET 6, and our own experience with .NET 7, highlighting the benefits and challenges faced during implementation for a client in the banking industry.
Overview of .NET 7
The latest version of .NET framework, .NET 7, offers a range of enhancements for developers to improve performance, language updates, and cloud-native, container-based development capabilities.

Some of the key features of .NET 7 include:
- Continued performance improvements.
- One BCL (base class library).
- Native support for ARM64 systems.
- Enhanced .NET support on Linux.
- HTTP/3 and improvements to minimal APIs for cloud-native apps.
- Native AOT for console applications.
- The F# 7 functional language features continued work on reliability and support for existing features.

.NET 7 is also being released in conjunction with other frameworks and tools such as:
- ASP.NET Core 7
- Entity Framework 7 (EF7)
- .NET MAUI (Multi-platform App UI)
- Windows Forms
- Windows Presentation Foundation
- Orleans 7 framework
For me, one of the most important feature of .NET 7 is the release of Entity Framework 7
EF Core 7 is the successor to EF Core 6, and can be referred as EF7 for brevity. EF7 contains many new features (167 enhancements and new features, both large and small, and 171 bug fixes !)
- JSON Columns.
- Bulk updates and deletes.
- Faster SaveChanges.
- Custom Database First templates (with T4 templates).
- Stored procedure mapping for insert/update/delete.
- New and improved interceptors and events.
EF7 contains also a lot of smaller enhancements you can see here.
One of the major enhancements in EF Core 7 is the addition of JSON Columns, which allows for more efficient storage and retrieval of JSON data. Additionally, bulk updates and deletes have been included, making it easier to perform these operations on large sets of data.
One of the most valuable new features in EF Core 7 for me personally is the ability to perform bulk updates and deletes. This allows me to eliminate the need for additional libraries that perform similar tasks and instead work with the standard functionality provided by EF Core 7.
EF Core 7 also offers faster performance, with improvements to the SaveChanges method. Custom Database First templates, using T4 templates, have also been introduced, allowing for greater flexibility in the design of the database.
Another notable feature in EF Core 7 is the added support for stored procedure mapping for insert, update, and delete operations. This allows for more granular control over how data is modified in the database.
Finally, EF Core 7 includes new and improved interceptors and events, providing more opportunities for developers to add custom logic and behavior to their applications.
Overall, EF Core 7 is a significant upgrade from its predecessor and offers a wide range of new and improved features for developers to take advantage of. It's a must-have for anyone working with .NET and databases.

In my experience as a .NET developer, one of the most important considerations when working with Entity Framework Core (EF Core) is the number of transactions and roundtrips that occur when inserting or updating data in the database. With the release of EF Core 7, this has become even more important, as the framework has introduced new optimizations to reduce the number of roundtrips and transactions that occur.
One such optimization is the removal of transactions when only a single statement is involved. In EF Core 6, every SQL statement was wrapped in a transaction, which resulted in additional roundtrips to the database. However, in EF Core 7, the framework recognizes that many databases guarantee transactionality for single SQL statements and will remove the transaction in these cases.
To demonstrate the impact of this optimization, I benchmarked the performance of the same code using both EF Core 6 and 7. The results showed a 25% improvement in performance with EF Core 7, thanks to the reduction in roundtrips.
It's important to note that these benchmarks were conducted on a SQL Server instance on my local machine. However, it's important to keep in mind that this is not a typical practice when benchmarking. In a production environment, the latency of the database plays a significant role in the overall performance of the application. Therefore, it's essential to conduct benchmarks on a similar environment to accurately evaluate performance.
In conclusion, the optimizations introduced in EF Core 7 are a welcome addition for .NET developers. The reduction in transactions and roundtrips can result in significant performance improvements, especially in scenarios where a single statement is involved

Migration to .NET 7
Migrating from .NET 6 to 7 requires upgrading to Visual Studio Code 2022 and updating the .NET Core SDK version in the global.json file. For example, if your global.json file currently has this line: "version": "6.0.200" it should be updated to: "version": "7.0.100".
The next step is to update the Target Framework (TFM) to .NET 7.0 in the project file. For example, if
your project file currently has this line:
, it should be updated to:
.
Finally, you will need to update all package references in the project file to version 7.*.* or later.
For example, if your project file currently has this line:
It's important to be aware that during the migration process, you may encounter package breaking changes and breaking changes in the new version of .NET that may require additional work. This might include rewriting certain parts of the code to address these breaking changes. However, with a thorough testing and quality assurance process in place, these challenges can be mitigated and the benefits of upgrading to the latest version of .NET can be fully realized. Once these steps are completed, your application should be fully migrated to .NET 7 and ready to perform its operations.
Tips and best practices for a smooth migration
When migrating from one version of .NET to another, it's important to have a solid plan in place to ensure a smooth and successful migration. One of the first steps in this process is to thoroughly assess the current codebase and identify any potential issues that may arise during the upgrade. This will help you develop a comprehensive plan for the upgrade and minimize any potential delays or complications.
A comprehensive plan should include testing and deployment strategies. Before starting the migration process, it is important to test the code thoroughly, both before and after the upgrade. This will help identify and resolve any issues that may arise during the migration process.
In addition to testing, it's important to use the latest tools and versions of the .NET framework. These will have the most up-to-date features and performance improvements, and will help ensure that the migration process runs smoothly.

Another important consideration is the potential for breaking changes in the new version of .NET and in packages you're using. It's important to be aware of these changes and plan accordingly, which may require rewriting certain parts of the code to address these breaking changes.
Before any migration, it is better to check the documentation of DotNet breaking changes and packages breaking changes.
Investing in quality assurance is crucial for a successful migration. It ensures the application is stable, secure, and performs well after the migration. Communication with the team and keeping them informed of progress is also important, as well as working together to resolve any issues that may arise.
By following these tips and best practices, you can ensure a smooth and successful migration from one version of .NET to another.
Our Experience
In our experience, migrating to .NET 7 presented a number of challenges. We encountered breaking changes in some libraries that we were using, which required us to rewrite certain EF7 methods and eliminate the use of external libraries. This process was time-consuming and required a significant amount of effort to ensure that all dependencies were updated and that the application was still functional.
We also had to migrate part of our old architecture under Microsoft Orleans, which we no longer deemed suitable for our needs. This required us to rethink our architecture, design new workflows, and implement new functionalities. Despite the additional effort required, we were able to adapt the old architecture to the new and gain performance doing so. This allowed us to take advantage of new capabilities offered by .NET 7 and improve the overall performance of our application.

The transition to EF7 brought another challenge as we had to adapt to the changes in Entity Framework's handling of Database First. This included creating T4 templates for reverse engineering the database, which required us to learn and implement new tools, adding an extra layer of complexity to the migration process.
Despite these challenges, we also encountered a number of benefits. We saw a significant increase in overall performance, as well as a reduction in memory and CPU usage. This was particularly evident in our data-intensive tasks, which required the use of Entity Framework. The new version of EF7 offered better performance, which translated into faster response times for our clients.

Look at the ratio column above, speed savings up to 98% 💪🏻
We also saw a reduction in the delay of EF7 requests, which was a major improvement for our clients who rely on our application for their daily operations. Additionally, we were able to reduce the use of transactions when they were not necessary, which resulted in a reduction of the load on our database and improved the overall performance of our application.
Additionally, we took advantage of this major update to upgrade our database from SQL Server 2017 to SQL Server 2019, and implemented Always Encrypted and Transparent Data Encryption for better data security for our client. This allowed us to comply with industry standards and regulations and ensured the protection of our client's sensitive data.
We were able to successfully navigate the migration process thanks to the thorough testing and quality assurance measures in place. The use of unit tests and multiple testing sessions with our client allowed us to identify and address any potential issues and breaking changes. This approach enabled us to ensure the perfect functionality of our application and identify areas for improvement in the codebase.
Conclusion
In conclusion, migrating to .NET 7 presented a number of challenges for our team. However, these challenges were outweighed by the significant benefits we saw in terms of performance, scalability, and security. Our clients also saw improvements in response times and data security. Despite the effort required, the migration allowed us to take advantage of new capabilities offered by .NET 7 and improve the overall performance of our application, providing a better service for our clients.
References
The following resources were used in the creation of this article:

Hi! I'm Nathan Wilcké
Experienced .NET 7 architect with a proven track record of successful projects in the field. Skilled in designing and implementing scalable and efficient solutions using the latest .NET technologies.