🟢 What a privilege to speak about the shift we’re living through in software development!
Last week, I had the opportunity to present a talk on how our field is evolving with advanced coding assistants and the rise of vibe coding.
I showed in practice how to:
- Create and use AI agents
- Connect with MCP servers
- Apply context and prompt engineering
- Build metric and review flows to improve AI-generated code
I also shared that vibe coding isn’t as simple as it sounds, it requires structure, context/prompt engineer, ai agents, mcp servers and human oversight.
Every question from the audience made it clear: by 2026, our profession will evolve even faster than we expect.
Are you already adapting your workflow to this new era of AI-assisted coding?
#ArtificialIntelligence #CodingAssistants #VibeCoding #SoftwareDevelopment #PromptEngineering #AIAgents #DotNet #TechTrends
🟣 𝐄𝐅 𝐂𝐨𝐫𝐞 𝐓𝐢𝐩 - 𝐔𝐬𝐞 𝐤𝐞𝐲𝐬𝐞𝐭 𝐩𝐚𝐠𝐢𝐧𝐚𝐭𝐢𝐨𝐧
Without paging, fetching all records can consume a lot of memory and processing time, pagination allows users to find information in a structured way, without having to deal with gigantic lists.
𝐊𝐞𝐲𝐬𝐞𝐭 𝐩𝐚𝐠𝐢𝐧𝐚𝐭𝐢𝐨𝐧, also known as cursor-based pagination, is a technique that retrieves the next set of records by using a reference to the last row from the previous page instead of skipping a fixed number of rows.
This approach avoids the performance penalty caused by large OFFSET values because the database doesn’t need to scan all skipped rows.
🔄 Repost to help other developers to write better queries
➕ Follow me (@pedroconstech) for more.
🟣 𝐄𝐅 𝐂𝐨𝐫𝐞 𝐓𝐢𝐩 - 𝐔𝐬𝐞 𝐤𝐞𝐲𝐬𝐞𝐭 𝐩𝐚𝐠𝐢𝐧𝐚𝐭𝐢𝐨𝐧
Without paging, fetching all records can consume a lot of memory and processing time, pagination allows users to find information in a structured way, without having to deal with gigantic lists.
𝐊𝐞𝐲𝐬𝐞𝐭 𝐩𝐚𝐠𝐢𝐧𝐚𝐭𝐢𝐨𝐧, also known as cursor-based pagination, is a technique that retrieves the next set of records by using a reference to the last row from the previous page instead of skipping a fixed number of rows.
This approach avoids the performance penalty caused by large OFFSET values because the database doesn’t need to scan all skipped rows.
🔄 Repost to help other developers to write better queries
➕ Follow me (@pedroconstech) for more.
🟣 𝐄𝐅 𝐂𝐨𝐫𝐞 𝐓𝐢𝐩 - 𝐔𝐬𝐞 𝐨𝐟𝐟𝐬𝐞𝐭 𝐩𝐚𝐠𝐢𝐧𝐚𝐭𝐢𝐨𝐧
Pagination is the process of splitting a large dataset into smaller, manageable chunks, commonly called pages. Instead of fetching thousands or millions of records in a single query, you only retrieve the specific slice of data required for the current view.
This reduces memory usage, improves query performance, and provides a better user experience.
𝐎𝐟𝐟𝐬𝐞𝐭 𝐩𝐚𝐠𝐢𝐧𝐚𝐭𝐢𝐨𝐧 is the simplest and most common way to implement pagination in .NET and SQL-based systems.
It uses an offset (the number of rows to skip) combined with a limit (the number of rows to return) to fetch a specific “page” of results.
If you need to easily navigate to any page of results (e.g. page 3, 10, etc.) or go back to page, OFFSET is simpler. It allows you to directly specify the page and number of items per page.
🔄 Repost to help other developers to write better queries
➕ Follow me (@pedroconstech) for more.
🟣 𝐄𝐅 𝐂𝐨𝐫𝐞 𝐓𝐢𝐩 - 𝐔𝐬𝐞 𝐨𝐟𝐟𝐬𝐞𝐭 𝐩𝐚𝐠𝐢𝐧𝐚𝐭𝐢𝐨𝐧
Pagination is the process of splitting a large dataset into smaller, manageable chunks, commonly called pages. Instead of fetching thousands or millions of records in a single query, you only retrieve the specific slice of data required for the current view.
This reduces memory usage, improves query performance, and provides a better user experience.
𝐎𝐟𝐟𝐬𝐞𝐭 𝐩𝐚𝐠𝐢𝐧𝐚𝐭𝐢𝐨𝐧 is the simplest and most common way to implement pagination in .NET and SQL-based systems.
It uses an offset (the number of rows to skip) combined with a limit (the number of rows to return) to fetch a specific “page” of results.
If you need to easily navigate to any page of results (e.g. page 3, 10, etc.) or go back to page, OFFSET is simpler. It allows you to directly specify the page and number of items per page.
🔄 Repost to help other developers to write better queries
➕ Follow me (@pedroconstech) for more.
🟣 𝐄𝐅 𝐂𝐨𝐫𝐞 𝐓𝐢𝐩 - 𝐀𝐯𝐨𝐢𝐝 𝐄𝐱𝐞𝐜𝐮𝐭𝐢𝐧𝐠 𝐔𝐩𝐝𝐚𝐭𝐞𝐬 𝐢𝐧 𝐚 𝐋𝐨𝐨𝐩
Just like ExecuteDelete, ExecuteUpdate is an efficient way to update multiple records directly in the database, Instead of manually fetching and modifying entities before calling SaveChanges(), we can use ExecuteUpdate to apply changes optimally
If you need to combine ExecuteUpdate with other changes to the context, use a transaction to ensure atomicity.
🔄 Repost to help other developers to write better queries
➕ Follow me (@pedroconstech) for more.
🟣 𝐄𝐅 𝐂𝐨𝐫𝐞 𝐓𝐢𝐩 - 𝐀𝐯𝐨𝐢𝐝 𝐄𝐱𝐞𝐜𝐮𝐭𝐢𝐧𝐠 𝐔𝐩𝐝𝐚𝐭𝐞𝐬 𝐢𝐧 𝐚 𝐋𝐨𝐨𝐩
Just like ExecuteDelete, ExecuteUpdate is an efficient way to update multiple records directly in the database, Instead of manually fetching and modifying entities before calling SaveChanges(), we can use ExecuteUpdate to apply changes optimally
If you need to combine ExecuteUpdate with other changes to the context, use a transaction to ensure atomicity.
🔄 Repost to help other developers to write better queries
➕ Follow me (@pedroconstech) for more.
🟣 𝐄𝐅 𝐂𝐨𝐫𝐞 𝐓𝐢𝐩 - 𝐀𝐯𝐨𝐢𝐝 𝐄𝐱𝐞𝐜𝐮𝐭𝐢𝐧𝐠 𝐃𝐞𝐥𝐞𝐭𝐞𝐬 𝐢𝐧 𝐚 𝐋𝐨𝐨𝐩
Although SaveChanges() is called once after the loop, this still causes Change Tracker overhead as entities need to be loaded and tracked. Additionally, the in-loop removal process may be slower than a direct mass delete in the bank.
With ExecuteDelete, deletion is performed much more efficiently. The method goes directly to the database and deletes the records at once, without having to load the entities or involve the Change Tracker.
Furthermore, there is less risk of failures and errors on the part of the developer and the database
If you need to combine ExecuteDelete with other changes to the context, use a transaction to ensure atomicity.
🔄 Repost to help other developers to write better queries
➕ Follow me (@pedroconstech) for more.
Time to git commit -m "2025" and git push into 2026.
Grateful for a year of building, learning, and evolving in the .NET / AI world. New year, new challenges to solve.
See you in production!
🟣 𝐄𝐅 𝐂𝐨𝐫𝐞 𝐓𝐢𝐩 - 𝐔𝐬𝐞 𝐄𝐚𝐠𝐞𝐫 𝐋𝐨𝐚𝐝𝐢𝐧𝐠 𝐖𝐢𝐬𝐞𝐥𝐲
Eager loading retrieves related data upfront in a single query through Include and ThenInclude, minimizing the number of database round-trips and enhancing overall performance.
Apply eager loading strategically. When possible, consider using filtered includes within Include and ThenInclude methods to restrict the amount of data retrieved alongside the main entity.
Retrieving related data through Eager Loading can cause performance problems if applied carelessly.
Loading unnecessary related entities using Include and ThenInclude methods may result in excessive database joins and generate large result sets that degrade performance.
🔄 Repost to help other developers to write better queries
➕ Follow me (@pedroconstech) for more.
🟣 𝐄𝐅 𝐂𝐨𝐫𝐞 𝐓𝐢𝐩 - 𝐔𝐬𝐞 𝐄𝐚𝐠𝐞𝐫 𝐋𝐨𝐚𝐝𝐢𝐧𝐠 𝐖𝐢𝐬𝐞𝐥𝐲
Eager loading retrieves related data upfront in a single query through Include and ThenInclude, minimizing the number of database round-trips and enhancing overall performance.
Apply eager loading strategically. When possible, consider using filtered includes within Include and ThenInclude methods to restrict the amount of data retrieved alongside the main entity.
Retrieving related data through Eager Loading can cause performance problems if applied carelessly.
Loading unnecessary related entities using Include and ThenInclude methods may result in excessive database joins and generate large result sets that degrade performance.
🔄 Repost to help other developers to write better queries
➕ Follow me (@pedroconstech) for more.
🟣 𝐄𝐅 𝐂𝐨𝐫𝐞 𝐓𝐢𝐩 - 𝐅𝐢𝐥𝐭𝐞𝐫 𝐄𝐚𝐫𝐥𝐲
Filtering with Where as early as possible reduces the amount of data processed and improves performance.
The order of the filters also matters because applying the most restrictive ones first reduces the number of data processed in subsequent steps.
This optimizes the query, reducing resource usage and improving performance. Filtering items such as IsActive and Stock before applying other criteria significantly reduces the load on the query.
🔄 Repost to help other developers to write better queries
➕ Follow me (@pedroconstech) for more.
🟣 𝐄𝐅 𝐂𝐨𝐫𝐞 𝐓𝐢𝐩 - 𝐅𝐢𝐥𝐭𝐞𝐫 𝐄𝐚𝐫𝐥𝐲
Filtering with Where as early as possible reduces the amount of data processed and improves performance.
The order of the filters also matters because applying the most restrictive ones first reduces the number of data processed in subsequent steps.
This optimizes the query, reducing resource usage and improving performance. Filtering items such as IsActive and Stock before applying other criteria significantly reduces the load on the query.
🔄 Repost to help other developers to write better queries
➕ Follow me (@pedroconstech) for more.
🟣 𝐄𝐅 𝐂𝐨𝐫𝐞 𝐓𝐢𝐩 - 𝐀𝐝𝐝 𝐃𝐚𝐭𝐚𝐛𝐚𝐬𝐞 𝐈𝐧𝐝𝐞𝐱𝐞𝐬
When appropriate indexes are missing, EF Core queries may perform full table scans, affecting your application's responsiveness.
Indexed queries run efficiently, whereas table scans often lead to degraded query performance.
Determine which columns are commonly used in WHERE clauses, ordering and add indexes to them.
In EF Core, you can configure these indexes through Fluent API settings in your DbContext setup or via annotations.
While indexes improve read performance, they come with trade-offs. Each index consumes additional storage and slows down write operations (INSERT, UPDATE, DELETE) since indexes must be maintained. Create indexes strategically, focusing only on columns that genuinely benefit from them.
🔄 Repost to help other developers to write better queries
➕ Follow me (@pedroconstech) for more.
🟣 𝐄𝐅 𝐂𝐨𝐫𝐞 𝐓𝐢𝐩 - 𝐀𝐝𝐝 𝐃𝐚𝐭𝐚𝐛𝐚𝐬𝐞 𝐈𝐧𝐝𝐞𝐱𝐞𝐬
When appropriate indexes are missing, EF Core queries may perform full table scans, affecting your application's responsiveness.
Indexed queries run efficiently, whereas table scans often lead to degraded query performance.
Determine which columns are commonly used in WHERE clauses, ordering and add indexes to them.
In EF Core, you can configure these indexes through Fluent API settings in your DbContext setup or via annotations.
While indexes improve read performance, they come with trade-offs. Each index consumes additional storage and slows down write operations (INSERT, UPDATE, DELETE) since indexes must be maintained. Create indexes strategically, focusing only on columns that genuinely benefit from them.
🔄 Repost to help other developers to write better queries
➕ Follow me (@pedroconstech) for more.
🔵 𝐅𝐚𝐜𝐭𝐨𝐫𝐲 𝐌𝐞𝐭𝐡𝐨𝐝 𝐏𝐚𝐭𝐭𝐞𝐫𝐧
The Factory Pattern is a creational design pattern that provides a flexible way to create objects, allowing subclasses to modify the type of object to be instantiated without changing the client code. This pattern is especially useful when the types of objects to be created may vary or need to be determined at runtime, promoting a more modular and maintainable design.
𝐖𝐡𝐞𝐧 𝐭𝐨 𝐔𝐬𝐞 𝐭𝐡𝐞 𝐅𝐚𝐜𝐭𝐨𝐫𝐲 𝐌𝐞𝐭𝐡𝐨𝐝 𝐏𝐚𝐭𝐭𝐞𝐫𝐧
🔹 𝐂𝐨𝐦𝐩𝐥𝐞𝐱 𝐨𝐫 𝐕𝐚𝐫𝐢𝐚𝐛𝐥𝐞 𝐎𝐛𝐣𝐞𝐜𝐭 𝐂𝐫𝐞𝐚𝐭𝐢𝐨𝐧: Encapsulates complex logic when object creation depends on multiple conditions.
🔹 𝐃𝐞𝐜𝐨𝐮𝐩𝐥𝐢𝐧𝐠 𝐎𝐛𝐣𝐞𝐜𝐭 𝐂𝐫𝐞𝐚𝐭𝐢𝐨𝐧: Separates creation logic from business logic, reducing dependencies.
🔹 𝐂𝐡𝐚𝐧𝐠𝐢𝐧𝐠 𝐃𝐲𝐧𝐚𝐦𝐢𝐜𝐚𝐥𝐥𝐲: When the creation of objects can be changed dynamically, but you still want to maintain an abstraction of how objects are instantiated.
🔹 𝐇𝐚𝐧𝐝𝐥𝐢𝐧𝐠 𝐏𝐫𝐨𝐝𝐮𝐜𝐭 𝐕𝐚𝐫𝐢𝐚𝐭𝐢𝐨𝐧𝐬: Supports multiple product versions or new types without modifying client code.
🔹 𝐂𝐮𝐬𝐭𝐨𝐦𝐢𝐳𝐚𝐛𝐥𝐞 𝐎𝐛𝐣𝐞𝐜𝐭 𝐂𝐫𝐞𝐚𝐭𝐢𝐨𝐧: Allows configuration-based object creation with parameters/options.
Note: Each service will have its own implementation, in this case the logic for the message queue.
🔄 Repost to help other developers to write better queries
➕ Follow me (@pedroconstech) for more.
🟣 𝐄𝐅 𝐂𝐨𝐫𝐞 𝐓𝐢𝐩 - 𝐔𝐬𝐞 𝐀𝐬𝐲𝐧𝐜𝐡𝐫𝐨𝐧𝐨𝐮𝐬 𝐌𝐞𝐭𝐡𝐨𝐝𝐬
The first example blocks the thread and can degrade application responsiveness.
Asynchronous methods allow your application to handle more simultaneous operations.
The second method uses ToListAsync() to avoid thread blocking and projects data directly to a DTO, optimizing data traffic.
Not every method needs to be async. In many scenarios, forcing async adds unnecessary complexity without any real benefit.
If your operation already runs on a dedicated thread, wrapping it in async just adds overhead, async is a tool, not a religion.
🔄 Repost to help other developers to write better queries
➕ Follow me (@pedroconstech) for more.
🟣 𝐄𝐅 𝐂𝐨𝐫𝐞 𝐓𝐢𝐩 - 𝐔𝐬𝐞 𝐀𝐬𝐲𝐧𝐜𝐡𝐫𝐨𝐧𝐨𝐮𝐬 𝐌𝐞𝐭𝐡𝐨𝐝𝐬
The first example blocks the thread and can degrade application responsiveness.
Asynchronous methods allow your application to handle more simultaneous operations.
The second method uses ToListAsync() to avoid thread blocking and projects data directly to a DTO, optimizing data traffic.
Not every method needs to be async. In many scenarios, forcing async adds unnecessary complexity without any real benefit.
If your operation already runs on a dedicated thread, wrapping it in async just adds overhead, async is a tool, not a religion.
🔄 Repost to help other developers to write better queries
➕ Follow me (@pedroconstech) for more.
🟣 𝐄𝐅 𝐂𝐨𝐫𝐞 𝐓𝐢𝐩 - 𝐔𝐬𝐞 𝐏𝐫𝐨𝐣𝐞𝐜𝐭𝐢𝐨𝐧𝐬
When working with large datasets, fetching unnecessary data can lead to performance issues. Projections in Entity Framework allow you to select only the data you need, optimizing performance.
Projection enables you to select specific fields from your entities, tailoring the result to your requirements instead of retrieving the whole entity. Additionally, when you use the Select method to create a projection, the query automatically bypasses EF Core's change tracker.
Fetch only the data you need, reducing memory usage and improving speed. Retrieve tailored data, making your models simpler and more maintainable, limit exposure by returning only necessary fields, protecting sensitive information.
🔄 Repost to help other developers to write better queries
➕ Follow me (@pedroconstech) for more.