AI · AIC-110

Generative AI for .NET Developers

Generative AI for .NET Developers is a hands-on course in building generative AI features with C# and .NET, connecting cloud and local models through Microsoft.Extensions.AI and covering structured output, function calling, vector search and RAG. It suits C# and ASP.NET Core developers who want to add AI to business applications, and you leave with a product search and chat assistant app on Aspire and Qdrant.

Updated
From 6,210 THB / person 6,900 −10% excl. VAT 7% · group rates available
PDFDownload the course outline
  • Duration18 hours · 3 days
  • FormatOnsite / live online
  • Next roundOn request
  • CertificateIncluded

Course overview

Many teams that build on C# and .NET want to add AI to their business applications, such as chat that answers questions from documents, search that understands meaning, or extracting data from text and images. Yet most of the examples they find are written in Python, which pushes them to run a separate service in another language or to tie their code to a single model provider they cannot easily replace, even though the .NET ecosystem now has enough generative AI building blocks to do the work directly in C#.

This course shows developers how to build generative AI applications with .NET 10. Learners start with how LLMs and tokens work, connect cloud models and local models running on Ollama through the IChatClient abstraction in Microsoft.Extensions.AI, and use them for chat, summarisation, classification, sentiment analysis and structured output into C# types. They then move on to function calling, embeddings, vector search, a RAG chat app and image analysis, before bringing everything together in a capstone product search and chat assistant app that runs on Aspire and Qdrant, along with what to think about before production: quality evaluation, cost, telemetry and security. (3 days, 6 hours per day, 18 hours in total, Intermediate level.)

What you’ll gain

  • Explain how LLMs, tokens and context windows work, and the limits that shape application design
  • Connect cloud and local models through IChatClient and switch providers without changing business logic
  • Design prompts for summarisation, classification and sentiment analysis and receive results as C# types
  • Let a model call C# functions safely through function calling
  • Generate embeddings and run semantic search with Microsoft.Extensions.VectorData
  • Build a RAG chat app that cites its sources, and analyse images with vision models
  • Structure an AI application with Aspire and Qdrant, including the dashboard and telemetry
  • Evaluate answer quality, control cost, and defend against prompt injection and personal data leaks

Who this course is for

  • C# and ASP.NET Core developers who want to add generative AI features to business applications
  • .NET backend developers who want to build RAG and vector search without switching to Python
  • Tech leads and software architects who choose AI approaches and tools for a .NET team
  • Developers maintaining existing .NET systems who need to add AI features step by step
  • Anyone who wants to try local models on their own machine alongside cloud models

Prerequisites

  • Able to write C#, including classes, records, async/await and basic LINQ
  • Basic ASP.NET Core skills for building a web API or web app, including dependency injection
  • Basic command-line, Git and NuGet skills
  • A laptop that can run the .NET 10 SDK, Docker Desktop and Ollama; 16 GB of RAM or more is recommended

Curriculum

Course Details

This is a new course for .NET developers. It runs for 3 days, 6 hours per day (18 hours in total, 09:00-16:00), as lectures with C# labs for every topic. Intermediate level; learners should already know basic C# and ASP.NET Core. It differs from Generative AI for Software Developers, which focuses on using AI to help write code, and from RAG & Knowledge Base, which teaches RAG concepts broadly. It builds on Web API with ASP.NET Core and goes straight

into building generative AI features in C# and .NET with Microsoft.Extensions.AI, Microsoft.Extensions.VectorData, Aspire and Qdrant. Learners use their own accounts: an Azure subscription with Microsoft Foundry or an API key from the model provider of their choice, billed by usage, plus local models on their own laptop with Ollama (16 GB of RAM or more is recommended) and Docker Desktop. The institute does not provide accounts, credits or hardware. Learners take home a lab guide, source code for every lab and the capstone project.

Day 1 LLM Basics and Your First C# Chat App

Section 1: Generative AI and LLMs from a Developer's View

  • How LLMs work: tokens, context windows, temperature and why hallucinations happen
  • Large models versus small language models, and when to choose a cloud or local model
  • The .NET AI stack: Microsoft.Extensions.AI, VectorData, Agent Framework and the MCP C# SDK
  • Token-based pricing, and data that should never be sent to an external model
  • Lab: set up the .NET 10 SDK, an IDE and Ollama, then pull a small model to try locally

Section 2: Lab: Connecting to Models through IChatClient

  • The IChatClient abstraction and how it separates app code from the model provider
  • Connect to a local model on Ollama and a cloud model through Microsoft Foundry
  • Register IChatClient with dependency injection and keep keys in user secrets
  • Switch providers through configuration without changing business logic
  • Lab: a console app that picks a cloud or local model from a settings file

Section 3: Chat, Streaming and Conversation History

  • System, user and assistant message roles, and keeping chat history
  • Stream responses so users see results straight away
  • Tune ChatOptions such as temperature and maximum output tokens
  • Keep the context from growing too long and control tokens per turn
  • Lab: streaming chat through an ASP.NET Core minimal API with a simple web page

Section 4: Prompt Patterns for Real Work

  • Write system prompts that set a clear role, scope and answer format
  • Few-shot examples, step-by-step instructions and delimiters that separate data from instructions
  • Keep prompts as templates in the project and version them with the code
  • Compare Thai-language results from cloud and local models
  • Lab: summarise, classify and analyse the sentiment of customer reviews

Section 5: Lab: Structured Output into C# Types

  • Have the model answer in JSON that follows a schema and map it straight to a C# record or class
  • Design types with enums and property descriptions so the model answers more accurately
  • Validate results, handle missing values and retry when output fails checks
  • Lab: extract data from emails and quotations into C# objects and save them to a database
Day 2 Tools, Embeddings, RAG and Vision

Section 6: Lab: Function Calling into Your C# Code

  • How tool calling works and what passes between the app and the model
  • Turn C# methods into tools with AIFunctionFactory, with parameter descriptions
  • Enable the function invocation middleware so tools are called automatically
  • Limit what tools can do and ask the user to confirm actions that have side effects
  • Lab: an assistant that checks order status and stock from a mock service

Section 7: Embeddings and Measuring Similarity

  • What embeddings are and how they power semantic search, clustering and recommendations
  • Generate embeddings with IEmbeddingGenerator from cloud models and models on Ollama
  • Compute cosine similarity in C# and interpret similarity scores
  • Split documents into chunks that work well for Thai text
  • Lab: search FAQs by meaning instead of exact keyword matches

Section 8: Lab: Vector Stores with Microsoft.Extensions.VectorData

  • Vector stores, collections and records in Microsoft.Extensions.VectorData
  • Define key, data and vector properties with attributes on a C# class
  • Upsert data, run vector search and filter results with ordinary conditions
  • Start with the in-memory provider, then switch to a real vector database with minimal code changes
  • Lab: find products from natural-language descriptions

Section 9: Lab: A RAG Chat App from the AI Chat Web App Template

  • Create a project from the AI Chat Web App template and explore what it generates
  • The ingestion pipeline: read documents, chunk them, create embeddings and store them
  • Retrieve context, assemble the prompt and show citations in the answer
  • Run the same app with a cloud model and a local model and compare answer quality
  • Lab: a chat app that answers from a sample company policy handbook and says when it does not know

Section 10: Lab: Image Analysis with Vision Models

  • Send images to IChatClient as multimodal content alongside text
  • Compare a cloud vision model with a local vision model on Ollama
  • Extract data from receipts or product photos into C# types with structured output
  • Accuracy limits, and keeping a person in the loop to check results before use
  • Lab: describe product photos and generate catalogue data from images
Day 3 Capstone with Aspire and Getting Ready for Production

Section 11: Lab: Structuring an AI App with Aspire

  • What Aspire is: the AppHost, service defaults and the dashboard for logs, traces and metrics
  • Add Qdrant as a resource in the AppHost with the Qdrant hosting integration
  • Wire the API and web frontend to Qdrant and the model provider through Aspire configuration
  • Pass connection strings and keys safely between services
  • Lab: lay out the capstone solution and run every service with one command

Section 12: Capstone 1: Product Search with Vector Search

  • Prepare sample product data and design the record stored in Qdrant
  • Create product embeddings and load them into Qdrant through a background job
  • Build a natural-language search endpoint with filters for category and price range
  • Compare semantic search results with traditional keyword search
  • Lab: a product search page that understands questions in Thai

Section 13: Capstone 2: A Shopping Assistant Chat

  • Combine RAG over the catalogue with function calling for stock and order checks
  • Stream answers and show the referenced products in the chat page
  • Use a local model for testing and a cloud model when higher quality is needed
  • Handle errors, timeouts and an unresponsive model provider
  • Workshop: test the assistant with a set of real questions and refine the prompts

Section 14: Lab: Evaluation, Cost, Caching and Telemetry

  • Evaluate answer quality with Microsoft.Extensions.AI.Evaluation, for example relevance and groundedness
  • Measure token usage per request and pick a model size that fits the job
  • Cache repeated responses with Microsoft.Extensions.AI middleware
  • Collect logs and traces with OpenTelemetry and view them on the Aspire dashboard
  • Lab: add an evaluation test suite to the capstone and rerun it after prompt changes

Section 15: Workshop: Security, PDPA and Next Steps

  • Direct and indirect prompt injection hidden in documents, and how to defend against it
  • Handle secrets correctly and mask personal data before sending it to external models, in line with PDPA
  • An overview of Microsoft Agent Framework and the MCP C# SDK for building agents next
  • Workshop: review the capstone with a security checklist, present it and review together

Schedule & training options

For individuals — public rounds

No public rounds are open right now. Join the waiting list and we will contact you first when the next round opens, or ask us on LINE. Or call 02-570-8449 or 088-807-9770

For organisations — in-house / private

  • Tailor the content to your team’s tools and projects
  • Your dates, at your office or live online
  • Quotation with tax ID for procurement
Corporate training quote

Instructors

Frequently asked questions

How does this course differ from Generative AI for Software Developers, RAG & Knowledge Base and Web API with ASP.NET Core?

Generative AI for Software Developers focuses on using AI to help write and maintain code, RAG & Knowledge Base covers RAG concepts and system design broadly, and Web API with ASP.NET Core teaches API development without AI. This course builds on ASP.NET Core basics and goes straight into building generative AI features natively in C# and .NET, with Microsoft.Extensions.AI, function calling, vector search, RAG, vision and a capstone on Aspire with Qdrant.

What do I need to know before joining?

You should be able to write C#, including classes, records, async/await and basic LINQ, and have built a web API or web app with ASP.NET Core using dependency injection. No prior machine learning or Python knowledge is needed.

What accounts or cloud model costs should I prepare for?

You use your own or your company's accounts: an Azure subscription with Microsoft Foundry, or an API key from the model provider you choose, billed by usage and paid by you. The institute does not provide accounts or cloud credits. Every lab is designed to work with a local model on Ollama, so you can complete the course without a cloud account.

What laptop specification do I need to run local models?

16 GB of RAM or more is recommended, and you need to be able to install the .NET 10 SDK, Docker Desktop and Ollama, with free disk space for model files. The labs use small models that run on an ordinary laptop, and response speed depends on your machine. The institute does not provide hardware or GPUs.

Why use Microsoft.Extensions.AI instead of calling a provider's SDK directly?

Microsoft.Extensions.AI provides IChatClient and IEmbeddingGenerator as common abstractions, so you can switch between cloud and local models through configuration and add function calling, caching and telemetry as middleware in the same way for every provider. Your application code is not tied to any single provider.

Does the course teach how to build AI agents?

The course focuses on the foundations agents rely on, namely function calling, RAG and structured output, and closes with an overview of Microsoft Agent Framework and the MCP C# SDK so you know where to go next. It does not go deep into multi-agent systems. Tool names and features in this field change often, and the content follows the latest versions on the training day.