AI Foundations for .NET Developers — Generative AI, LLMs, and Prompt Engineering in C#
Build a solid understanding of AI concepts — from how LLMs work to RAG, prompt engineering, and generative AI — all through the lens of C# and .NET.
What You'll Learn
- Understand how large language models work and their capabilities
- Apply prompt engineering techniques in C# applications
- Explain RAG architecture and when to use it
- Compare LLM providers and their .NET SDKs
- Evaluate AI integration opportunities in existing .NET projects
Prerequisites
- C# fundamentals
- .NET 8+ development environment
Learning Path Articles
- 1
Your First AI App in .NET: Make One API Call and See What Happens
Build your first Azure AI Foundry app in C# in 15 minutes. No Python. No complexity. One API call with GPT-5.4-mini and .NET 10 that changes how you think about AI.
Beginner 10 min read workshop - 2
Microsoft.Extensions.AI: IChatClient Guide
Learn Microsoft.Extensions.AI in .NET: IChatClient, IEmbeddingGenerator, provider-agnostic chat, middleware, caching, logging, and DI.
Intermediate 12 min read university - 3
Generative AI for .NET Developers
Learn generative AI for .NET: LLMs, tokens, embeddings, Semantic Kernel, Microsoft.Extensions.AI, ML.NET, and ONNX in C#.
Beginner 10 min read university - 4
How LLMs Work: Tokens, Context Windows & Next-Token Prediction Explained
How GPT, Claude, and LLMs generate text via next-token prediction. Tokens, context windows, temperature, and transformers — explained for .NET developers.
Beginner 12 min read university - 5
MEAI vs Semantic Kernel vs Agent Framework
Choose the right .NET AI library: Microsoft.Extensions.AI for abstraction, Semantic Kernel for orchestration, Agent Framework for agents.
Intermediate 12 min read university - 6
Prompt Engineering in C#: System Messages, Few-Shot & Structured Output
Prompt engineering with C# code examples: system messages, few-shot prompting, structured JSON output, and common mistakes. Azure OpenAI + Semantic Kernel.
Beginner 14 min read university - 7
DI for AI Services in ASP.NET Core: IChatClient, Kernel & Keyed Services
Register IChatClient, IEmbeddingGenerator, and Semantic Kernel in ASP.NET Core DI. Keyed services for multi-model, plugin injection, and unit testing patterns.
Intermediate 13 min read university - 8
LLM Providers for .NET: OpenAI vs Azure
Compare OpenAI, Azure OpenAI, Anthropic, and Gemini for .NET apps: SDK support, pricing, rate limits, and Semantic Kernel connectors.
Beginner 12 min read university - 9
Azure OpenAI Token Counting in C#
Count Azure OpenAI tokens in C# with Microsoft.ML.Tokenizers. Add budgets, prevent context overflow, estimate cost, and enforce limits.
Intermediate 13 min read university - 10
Azure OpenAI Structured Outputs: C# JSON Fix
Get valid JSON from Azure OpenAI in C#. Use ChatResponseFormat, JSON schema, MEAI, and Semantic Kernel patterns that avoid 400 errors.
Intermediate 13 min read university - 11
Vector Databases for .NET Compared
Compare Cosmos DB, Azure AI Search, Qdrant, pgvector, and SQL Server for .NET RAG apps. Includes C# and Semantic Kernel guidance.
Intermediate 16 min read university - 12
Phi-4 Local in C#: Ollama vs ONNX vs Foundry
Run Phi-4 locally in .NET and compare Ollama, ONNX Runtime GenAI, and Foundry Local with setup code and Semantic Kernel examples.
Intermediate 14 min read university