<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: El Mehdi Taii</title>
    <description>The latest articles on Forem by El Mehdi Taii (@elmehditaii).</description>
    <link>https://forem.com/elmehditaii</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3640657%2F8333b481-16ad-414e-98fb-14ceca54d2ad.png</url>
      <title>Forem: El Mehdi Taii</title>
      <link>https://forem.com/elmehditaii</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/elmehditaii"/>
    <language>en</language>
    <item>
      <title>🚀 Simplify Your C# Collections with the Spread Operator (..)</title>
      <dc:creator>El Mehdi Taii</dc:creator>
      <pubDate>Sat, 13 Dec 2025 20:08:57 +0000</pubDate>
      <link>https://forem.com/elmehditaii/simplify-your-c-collections-with-the-spread-operator--3d8m</link>
      <guid>https://forem.com/elmehditaii/simplify-your-c-collections-with-the-spread-operator--3d8m</guid>
      <description>&lt;p&gt;If you're still using Array.Copy(), .Concat(), or .AddRange() to combine collections in C#, you're working too hard. C# 13 introduced the spread operator (..) that makes collection manipulation cleaner, faster, and more intuitive.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Traditional collection operations in C# are verbose and require multiple steps. Whether you're combining arrays, adding elements, or copying collections, you end up with code that's harder to read and maintain.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: Spread Operator (..)
&lt;/h2&gt;

&lt;p&gt;The spread operator (..) lets you expand collections inline, making your code more expressive and eliminating boilerplate. Think of it as "unpacking" a collection right where you need it.&lt;br&gt;
&lt;strong&gt;Code Examples&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1️⃣** Basic Collection Combining**&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Favdl6jpz35ayb97amj06.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Favdl6jpz35ayb97amj06.png" alt=" " width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2️⃣ &lt;strong&gt;Adding Elements to Collections&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ue9knaqz1hvmr054dy3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ue9knaqz1hvmr054dy3.png" alt=" " width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3️⃣ &lt;strong&gt;Working with Different Collection Types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmpgbnbrg8y1jyf7gmsvi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmpgbnbrg8y1jyf7gmsvi.png" alt=" " width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4️⃣ &lt;strong&gt;Real-World Use Case: Building Configuration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8nazfjelkv373tiuk1zs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8nazfjelkv373tiuk1zs.png" alt=" " width="800" height="477"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;5️⃣ &lt;strong&gt;Creating Copies&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgknkqq4ab1uqqn919f3o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgknkqq4ab1uqqn919f3o.png" alt=" " width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;6️⃣ &lt;strong&gt;API Response Building&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9yd2ixfr1whvygp51nel.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9yd2ixfr1whvygp51nel.png" alt=" " width="800" height="311"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Key Benefits&lt;/u&gt;&lt;br&gt;
✅ Readability: Code intention is crystal clear&lt;br&gt;
✅ Less Boilerplate: No more manual array copying or .Concat() chains&lt;br&gt;
✅ Type Safe: Full compile-time type checking&lt;br&gt;
✅ Performance: Efficient memory allocation&lt;br&gt;
✅ Flexibility: Works with any IEnumerable&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance Comparison&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkc5mg5xr7ljj6fdizlrs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkc5mg5xr7ljj6fdizlrs.png" alt=" " width="800" height="522"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Best Practices&lt;br&gt;
🔹 Use spread operator for:&lt;/p&gt;

&lt;p&gt;Combining multiple collections&lt;br&gt;
Creating collection copies&lt;br&gt;
Building collections with mixed sources&lt;br&gt;
Dynamic collection composition&lt;/p&gt;

&lt;p&gt;🔹 Remember:&lt;/p&gt;

&lt;p&gt;Creates shallow copies (like most collection operations)&lt;br&gt;
Works with any IEnumerable type&lt;br&gt;
Can be mixed with individual elements&lt;br&gt;
Multiple spreads in one expression are fine&lt;/p&gt;

&lt;p&gt;🔹 Common Patterns:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5yhb4gl1jtg8t4s4of3c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5yhb4gl1jtg8t4s4of3c.png" alt=" " width="800" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Requirements&lt;/u&gt;&lt;br&gt;
⚠️ Note: The spread operator requires:&lt;/p&gt;

&lt;p&gt;C# 13 or later&lt;br&gt;
.NET 9 or later&lt;/p&gt;

&lt;p&gt;If you're on older versions, stick with traditional methods like .Concat(), .AddRange(), or Array.Copy().&lt;br&gt;
When NOT to Use Spread Operator&lt;br&gt;
🔹 If you need to modify elements during combination (use LINQ .Select() instead)&lt;br&gt;
🔹 If you're working with very large collections and need specific performance optimizations&lt;br&gt;
🔹 If you're on C# 12 or earlier (not available)&lt;br&gt;
&lt;strong&gt;The Bottom Line&lt;/strong&gt;&lt;br&gt;
The spread operator is a small syntax addition that makes a huge difference in code clarity. If you're building, combining, or copying collections, stop writing boilerplate and start using ... Your future self (and your code reviewers) will thank you.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>csharp</category>
    </item>
    <item>
      <title>🚀 Boost Your EF Core Performance with AsNoTracking()</title>
      <dc:creator>El Mehdi Taii</dc:creator>
      <pubDate>Fri, 12 Dec 2025 10:10:50 +0000</pubDate>
      <link>https://forem.com/elmehditaii/boost-your-ef-core-performance-with-asnotracking-ee5</link>
      <guid>https://forem.com/elmehditaii/boost-your-ef-core-performance-with-asnotracking-ee5</guid>
      <description>&lt;p&gt;If you're working with Entity Framework Core and wondering why your read-heavy operations feel sluggish, you might be paying a hidden performance cost: change tracking overhead.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;By default, EF Core tracks every entity it retrieves from the database. This tracking mechanism monitors changes to entities so that when you call SaveChanges(), EF Core knows exactly what to update. While powerful for CRUD operations, this comes with memory and CPU overhead—especially problematic when you're just reading data.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: AsNoTracking()
&lt;/h2&gt;

&lt;p&gt;The &lt;u&gt;AsNoTracking()&lt;/u&gt; method tells EF Core: "I'm only reading this data, don't track changes." This eliminates tracking overhead and can significantly improve performance for read-only scenarios.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Examples
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1️⃣ Basic Query with AsNoTracking()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftnx0uskgj8z0htqfsyt0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftnx0uskgj8z0htqfsyt0.png" alt=" " width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2️⃣ Comparing Tracking vs No-Tracking Behavior&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fodti5mokyrfcob61ew9e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fodti5mokyrfcob61ew9e.png" alt=" " width="800" height="347"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3️⃣ Performance Use-Case: API Endpoints &amp;amp; Dashboards&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyb9cu4a50rt06rxqe35o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyb9cu4a50rt06rxqe35o.png" alt=" " width="800" height="841"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4️⃣ When NOT to Use AsNoTracking()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzr7f40owbp3bg1m8yvn2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzr7f40owbp3bg1m8yvn2.png" alt=" " width="800" height="581"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5️⃣ AsNoTrackingWithIdentityResolution()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftx448bo99gejahe9ynb1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftx448bo99gejahe9ynb1.png" alt=" " width="800" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Benefits&lt;/strong&gt;&lt;br&gt;
✅ Performance: 10-30% faster queries in read-heavy scenarios&lt;br&gt;
✅ Memory: Reduced memory footprint—no tracking metadata stored&lt;br&gt;
✅ Scalability: Better throughput for high-volume read operations&lt;br&gt;
✅ Simplicity: One method call for immediate gains&lt;/p&gt;

&lt;p&gt;Best Practices&lt;br&gt;
🔹 Use AsNoTracking() for:&lt;/p&gt;

&lt;p&gt;Read-only API endpoints&lt;br&gt;
Reports and dashboards&lt;br&gt;
Data export operations&lt;br&gt;
Search and filtering queries&lt;/p&gt;

&lt;p&gt;🔹 Avoid AsNoTracking() when:&lt;/p&gt;

&lt;p&gt;You need to update entities afterward&lt;br&gt;
Working with complex object graphs where identity matters&lt;br&gt;
The performance gain is negligible (very small result sets)&lt;/p&gt;

&lt;p&gt;🔹 Global Configuration:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F87yqrcsghhoh70i417n1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F87yqrcsghhoh70i417n1.png" alt=" " width="800" height="215"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹 Use AsNoTrackingWithIdentityResolution() when you need proper entity identity without tracking overhead (EF Core 5.0+)&lt;/p&gt;

&lt;h2&gt;
  
  
  The Bottom Line
&lt;/h2&gt;

&lt;p&gt;If you're querying data without modifying it, you're probably paying for tracking you don't need. Add .AsNoTracking() to your read queries and watch your application's performance improve.&lt;/p&gt;

</description>
      <category>database</category>
      <category>csharp</category>
      <category>performance</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>🚀 Entity Framework Core 10: The JSON &amp; Complex Types Revolution Is Here!</title>
      <dc:creator>El Mehdi Taii</dc:creator>
      <pubDate>Wed, 03 Dec 2025 10:36:47 +0000</pubDate>
      <link>https://forem.com/elmehditaii/entity-framework-core-10-the-json-complex-types-revolution-is-here-1l39</link>
      <guid>https://forem.com/elmehditaii/entity-framework-core-10-the-json-complex-types-revolution-is-here-1l39</guid>
      <description>&lt;p&gt;EF Core 10 transforms how we model data with two major innovations that radically simplify development.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Complex Types: No More Unnecessary Tables&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Complex types let you model contained types within your entities without their own identity, avoiding traditional JOINs and delivering better performance. No need to create separate tables for every structured object!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xcwv60nvsyuj65qao5k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xcwv60nvsyuj65qao5k.png" alt=" " width="800" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JSON Columns: Flexibility Without Compromise&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can now map complex properties to single JSON columns, perfect for dynamic or semi-structured data:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1swc8tx2i06rb7c4qji5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1swc8tx2i06rb7c4qji5.png" alt=" " width="800" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Native JSON Type in SQL Server 2025: Performance &amp;amp; Security&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The new JSON data type brings significant efficiency improvements and a safer way to store and interact with JSON. On Azure SQL Database and SQL Server 2025, EF automatically uses the native JSON type by default.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;u&gt;Concrete Benefits:&lt;/u&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Type-safe queries on your JSON documents&lt;/li&gt;
&lt;li&gt;Bulk updates with ExecuteUpdateAsync directly in JSON&lt;/li&gt;
&lt;li&gt;No more schema migrations to add fields&lt;/li&gt;
&lt;li&gt;Native JSON indexing for optimal performance&lt;/li&gt;
&lt;li&gt;Cleaner, more maintainable code&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fco0cvjrisx78cfa53203.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fco0cvjrisx78cfa53203.png" alt=" " width="800" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;EF Core 10 represents a major leap forward in handling structured and semi-structured data. Now's the time to explore these new capabilities!&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnetcore</category>
      <category>entityframeworkcore</category>
      <category>json</category>
    </item>
    <item>
      <title>🚀 Introducing Better API Documentation with ProducesResponseType</title>
      <dc:creator>El Mehdi Taii</dc:creator>
      <pubDate>Tue, 02 Dec 2025 09:16:16 +0000</pubDate>
      <link>https://forem.com/elmehditaii/introducing-better-api-documentation-with-producesresponsetype-3h6b</link>
      <guid>https://forem.com/elmehditaii/introducing-better-api-documentation-with-producesresponsetype-3h6b</guid>
      <description>&lt;h2&gt;
  
  
  Introducing ProducesResponseType
&lt;/h2&gt;

&lt;p&gt;We've all been there: consuming an API endpoint and having no clue what response to expect, digging through code to figure out status codes, or maintaining Swagger docs that never match the actual implementation. It's frustrating, time-consuming, and leads to runtime errors that could've been caught earlier. That's why I'm excited to highlight ProducesResponseType—a powerful attribute in .NET Core that explicitly declares your API response contracts, making your endpoints self-documenting and giving both developers and tools like Swagger complete clarity on what your API returns.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;The Problem&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ever worked with an API and had no idea what response types to expect? Or spent hours debugging because the documentation didn't match the actual responses?&lt;br&gt;
If you're building APIs in .NET Core, you know the struggle: clients consume your endpoints blindly, Swagger docs are incomplete, and developers waste time guessing response structures.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;The Solution&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The ProducesResponseType attribute is a game-changer for .NET Core API development. It explicitly declares what your endpoints return, making your APIs self-documenting and predictable.&lt;br&gt;
This attribute tells both developers AND tools (like Swagger/OpenAPI) exactly what to expect from your endpoints—including status codes and response types.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Code Examples&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example 1: Basic Usage&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9nqpdnonl75ajwsfxyok.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9nqpdnonl75ajwsfxyok.png" alt=" " width="800" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example 2: Multiple Success Responses&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frw2o6nz4r7gbtg8njr79.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frw2o6nz4r7gbtg8njr79.png" alt=" " width="800" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example 3: Generic Response with Pagination&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh28mjyr87s6quow2dlas.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh28mjyr87s6quow2dlas.png" alt=" " width="800" height="216"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example 4: File Download Endpoint&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbgxf2j6j3n8u6tvrgp7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbgxf2j6j3n8u6tvrgp7e.png" alt=" " width="800" height="238"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Key Benefits&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;✅ Crystal-Clear Documentation – Swagger/OpenAPI automatically generates accurate, comprehensive API docs&lt;br&gt;
✅ Better Developer Experience – Frontend teams know exactly what to expect without trial and error&lt;br&gt;
✅ Type Safety – Strong typing means fewer runtime errors and easier client code generation&lt;br&gt;
✅ Improved Maintainability – Response contracts are explicit, making refactoring safer&lt;br&gt;
✅ Enhanced Tooling – IDEs and API clients can provide better IntelliSense and validation&lt;br&gt;
✅ Professional Standards – Your API follows industry best practices for REST documentation&lt;/p&gt;

&lt;p&gt;&lt;u&gt;The Bottom Line&lt;/u&gt;&lt;br&gt;
ProducesResponseType transforms your .NET Core APIs from black boxes into well-documented, predictable contracts. It's a small attribute that makes a massive difference in API quality and team productivity.&lt;/p&gt;

</description>
      <category>api</category>
      <category>backend</category>
      <category>dotnetcore</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>🚀 How to Build Dynamic LINQ Queries Easily with WhereDynamic in .NET8+</title>
      <dc:creator>El Mehdi Taii</dc:creator>
      <pubDate>Tue, 02 Dec 2025 08:30:02 +0000</pubDate>
      <link>https://forem.com/elmehditaii/how-to-build-dynamic-linqqueries-easily-withwheredynamic-in-net8-i7o</link>
      <guid>https://forem.com/elmehditaii/how-to-build-dynamic-linqqueries-easily-withwheredynamic-in-net8-i7o</guid>
      <description>&lt;h2&gt;
  
  
  Introducing WhereDynamic
&lt;/h2&gt;

&lt;p&gt;We've all been there: writing endless if statements to build conditional queries, or duplicating logic across multiple endpoints just to handle different filter combinations. It's messy, error-prone, and hard to maintain. &lt;br&gt;
That's why I'm excited to announce WhereDynamic a powerful new feature that lets you build LINQ queries dynamically at runtime, without hardcoding filters or sacrificing type safety.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;The Problem &lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When building APIs or data-driven applications with .NET and Entity Framework, we often need to apply filters based on user input. Traditional approaches lead to bloated code:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F667ez2nj0pslv9t1ywrj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F667ez2nj0pslv9t1ywrj.png" alt=" " width="800" height="323"&gt;&lt;/a&gt;&lt;br&gt;
This doesn't scale well and becomes a maintenance nightmare.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;The Solution&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
WhereDynamic allows you to construct flexible, runtime queries with a clean, fluent API:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fybdx82222of3b5rqesm0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fybdx82222of3b5rqesm0.png" alt=" " width="800" height="279"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Practical Use Cases&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1 - Advanced Search Filters&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb0ctmm9271cyi1zhhe6w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb0ctmm9271cyi1zhhe6w.png" alt=" " width="800" height="173"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2 - Multi-Tenant Data Filtering&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Funylimmkl2vq5czyfkw2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Funylimmkl2vq5czyfkw2.png" alt=" " width="800" height="179"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3 - API Query Parameters&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhuyvgmsis94gpef14iqk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhuyvgmsis94gpef14iqk.png" alt=" " width="800" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4 - Complex Nested Conditions&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fedc4z495aibsop0eqe36.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fedc4z495aibsop0eqe36.png" alt=" " width="800" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Key Benefits&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cleaner Code – Eliminate repetitive conditional logic &lt;/li&gt;
&lt;li&gt;Type Safety – Compile-time checks with IntelliSense support&lt;/li&gt;
&lt;li&gt;Performance – Translates directly to optimized SQL queries&lt;/li&gt;
&lt;li&gt;Maintainability – Centralized filter logic, easier to test and extend&lt;/li&gt;
&lt;li&gt;Flexibility – Works seamlessly with existing Entity Framework code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Built For Modern .Net&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;WhereDynamic is built on .NET 8+, fully compatible with Entity Framework Core, and designed with performance and developer experience in mind. Whether you're building REST APIs, GraphQL endpoints, or complex reporting systems, it adapts to your needs.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>dotnetcore</category>
    </item>
  </channel>
</rss>
