Skip to main content

Posts

Showing posts with the label C# List vs Dictionary

Azure AI Search with C#: Build Smart Search (2026)

Learn Azure AI Search with C# — index data, run vector and hybrid queries, and add RAG to your .NET app. Start building intelligent search today. If your application's search box still runs a LIKE '%term%' query against SQL Server, your users are quietly suffering. They type "cheap laptop for uni" and get zero results because your catalogue says "affordable notebook for students." Azure AI Search with C# fixes exactly this problem: it combines classic keyword search, vector embeddings, and semantic reranking into a single managed service that you can drive from .NET with a few dozen lines of code. In this tutorial you'll build a working search index from scratch, run keyword, vector, and hybrid queries, and finish with a Retrieval Augmented Generation (RAG) pattern that grounds an LLM in your own data. This guide targets .NET 9 and the Azure.Search.Documents v11 SDK. Every snippet is runnable. We'll explain why each design choice matter...

C# List vs Dictionary vs HashSet: Performance Guide

C# collections performance compared: List vs Dictionary vs HashSet vs Queue with Big O tables, benchmarks, and code. Learn which collection to use now. Choosing the right C# collections is one of the highest-impact performance decisions you can make in .NET — and one of the most common interview questions for C# developers. Should you use a List<T> , a Dictionary<TKey, TValue> , a HashSet<T> , or a Queue<T> ? Pick wrong, and a lookup that should take nanoseconds turns into a linear scan that melts your CPU at scale. In this C# collections performance guide, we compare all four with Big O complexity tables, runnable code examples, and real-world guidance on when to use each — so you never have to guess again. Why C# Collections Performance Matters Every collection in .NET is a trade-off between memory layout, lookup speed, insertion cost, and ordering guarantees. The difference between List<T>.Contains() and HashSet<T>.Contains() isn't a...