๐ข 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.
๐ฃ ๐๐ ๐๐จ๐ซ๐ ๐๐ข๐ฉ -ย ๐๐ฌ๐ ๐จ๐๐๐ฌ๐๐ญ ๐ฉ๐๐ ๐ข๐ง๐๐ญ๐ข๐จ๐ง
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.
๐ฃ ๐๐ ๐๐จ๐ซ๐ ๐๐ข๐ฉ -ย ๐๐ฏ๐จ๐ข๐ ๐๐ฑ๐๐๐ฎ๐ญ๐ข๐ง๐ ๐๐๐ฅ๐๐ญ๐๐ฌ ๐ข๐ง ๐ ๐๐จ๐จ๐ฉ
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.
๐ฃ ๐๐ ๐๐จ๐ซ๐ ๐๐ข๐ฉ -ย ๐ ๐ข๐ฅ๐ญ๐๐ซ ๐๐๐ซ๐ฅ๐ฒ
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.
๐ตย ๐ ๐๐๐ญ๐จ๐ซ๐ฒ ๐๐๐ญ๐ก๐จ๐ ๐๐๐ญ๐ญ๐๐ซ๐ง
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.
๐ฃ ๐๐ ๐๐จ๐ซ๐ ๐๐ข๐ฉ -ย ๐๐ฌ๐ ๐๐ซ๐จ๐ฃ๐๐๐ญ๐ข๐จ๐ง๐ฌ
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.
๐ฃ ๐๐ ๐๐จ๐ซ๐ ๐๐ข๐ฉ -ย ๐๐จ๐จ๐ฌ๐ญ ๐๐จ๐ฎ๐ซ ๐๐ฎ๐๐ซ๐ฒ ๐๐๐ซ๐๐จ๐ซ๐ฆ๐๐ง๐๐ ๐ฐ๐ข๐ญ๐ก ๐๐ฌ๐๐จ๐๐ซ๐๐๐ค๐ข๐ง๐
Did you know you can significantly improve the performance of your read-only queries in Entity Framework Core? Hereโs a simple tip that can make a big difference: use AsNoTracking.
When you query your database using Entity Framework Core, it tracks the entities it retrieves by default. This is useful if you plan to update them, but it can be a performance hit if youโre just reading data. Thatโs where AsNoTracking comes in!
๐๐ก๐ฒ ๐๐ฌ๐ ๐๐ฌ๐๐จ๐๐ซ๐๐๐ค๐ข๐ง๐ ?
1 - ๐ ๐๐ฌ๐ญ๐๐ซ ๐๐ฎ๐๐ซ๐ข๐๐ฌ: By disabling tracking, EF Core skips the overhead of tracking changes, which means your queries execute faster.
2 - ๐๐๐๐ฎ๐๐๐ ๐๐๐ฆ๐จ๐ซ๐ฒ ๐๐ฌ๐๐ ๐: Without tracking, your application uses less memory, especially important when dealing with large datasets.
3 - ๐๐๐ซ๐๐๐๐ญ ๐๐จ๐ซ ๐๐๐๐-๐๐ง๐ฅ๐ฒ ๐๐๐๐ง๐๐ซ๐ข๐จ๐ฌ:ย If youโre only displaying data and donโt need to update it, AsNoTracking is the way to go.
๐ Repost to help other developers to write better queries
โ Follow me (@pedroconstech) for more.