AI Engineer | Senior Full Stack Developer | Speaker | Helping .NET Developers sharpen their skills through my Blog Daily Posts on X & LinkedIn

Joined July 2025
78 Photos and videos
Pinned Tweet
๐ŸŸข 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
1
3
192
Pedro Constantino retweeted
๐ŸŸฃ ๐„๐… ๐‚๐จ๐ซ๐ž ๐“๐ข๐ฉ -ย ๐”๐ฌ๐ž ๐ค๐ž๐ฒ๐ฌ๐ž๐ญ ๐ฉ๐š๐ ๐ข๐ง๐š๐ญ๐ข๐จ๐ง 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.
1
2
26
Pedro Constantino retweeted
๐ŸŸฃ ๐„๐… ๐‚๐จ๐ซ๐ž ๐“๐ข๐ฉ -ย ๐”๐ฌ๐ž ๐จ๐Ÿ๐Ÿ๐ฌ๐ž๐ญ ๐ฉ๐š๐ ๐ข๐ง๐š๐ญ๐ข๐จ๐ง 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.
1
1
19
Pedro Constantino retweeted
๐ŸŸฃ ๐„๐… ๐‚๐จ๐ซ๐ž ๐“๐ข๐ฉ -ย ๐€๐ฏ๐จ๐ข๐ ๐„๐ฑ๐ž๐œ๐ฎ๐ญ๐ข๐ง๐  ๐”๐ฉ๐๐š๐ญ๐ž๐ฌ ๐ข๐ง ๐š ๐‹๐จ๐จ๐ฉ 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.
1
1
32
๐ŸŸฃ ๐„๐… ๐‚๐จ๐ซ๐ž ๐“๐ข๐ฉ -ย ๐€๐ฏ๐จ๐ข๐ ๐„๐ฑ๐ž๐œ๐ฎ๐ญ๐ข๐ง๐  ๐ƒ๐ž๐ฅ๐ž๐ญ๐ž๐ฌ ๐ข๐ง ๐š ๐‹๐จ๐จ๐ฉ 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.
1
8
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!
1
12
Pedro Constantino retweeted
๐ŸŸฃ ๐„๐… ๐‚๐จ๐ซ๐ž ๐“๐ข๐ฉ -ย ๐”๐ฌ๐ž ๐„๐š๐ ๐ž๐ซ ๐‹๐จ๐š๐๐ข๐ง๐  ๐–๐ข๐ฌ๐ž๐ฅ๐ฒ 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.
1
2
38
Pedro Constantino retweeted
๐ŸŸฃ ๐„๐… ๐‚๐จ๐ซ๐ž ๐“๐ข๐ฉ -ย ๐…๐ข๐ฅ๐ญ๐ž๐ซ ๐„๐š๐ซ๐ฅ๐ฒ 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.
1
2
30
Pedro Constantino retweeted
๐ŸŸฃ ๐„๐… ๐‚๐จ๐ซ๐ž ๐“๐ข๐ฉ - ๐€๐๐ ๐ƒ๐š๐ญ๐š๐›๐š๐ฌ๐ž ๐ˆ๐ง๐๐ž๐ฑ๐ž๐ฌ 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.
1
2
18
๐Ÿ”ตย ๐…๐š๐œ๐ญ๐จ๐ซ๐ฒ ๐Œ๐ž๐ญ๐ก๐จ๐ ๐๐š๐ญ๐ญ๐ž๐ซ๐ง 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.
1
10
Pedro Constantino retweeted
๐ŸŸฃ ๐„๐… ๐‚๐จ๐ซ๐ž ๐“๐ข๐ฉ -ย ๐”๐ฌ๐ž ๐€๐ฌ๐ฒ๐ง๐œ๐ก๐ซ๐จ๐ง๐จ๐ฎ๐ฌ ๐Œ๐ž๐ญ๐ก๐จ๐๐ฌ 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.
1
2
27
Pedro Constantino retweeted
๐ŸŸฃ ๐„๐… ๐‚๐จ๐ซ๐ž ๐“๐ข๐ฉ -ย ๐”๐ฌ๐ž ๐๐ซ๐จ๐ฃ๐ž๐œ๐ญ๐ข๐จ๐ง๐ฌ 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.
1
2
33
Pedro Constantino retweeted
๐ŸŸฃ ๐„๐… ๐‚๐จ๐ซ๐ž ๐“๐ข๐ฉ -ย ๐๐จ๐จ๐ฌ๐ญ ๐˜๐จ๐ฎ๐ซ ๐๐ฎ๐ž๐ซ๐ฒ ๐๐ž๐ซ๐Ÿ๐จ๐ซ๐ฆ๐š๐ง๐œ๐ž ๐ฐ๐ข๐ญ๐ก ๐€๐ฌ๐๐จ๐“๐ซ๐š๐œ๐ค๐ข๐ง๐  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.
1
3
24