# Prompt Engineering for .NET Developers

A free ebook that teaches .NET developers to build production AI-powered applications in C#, pairing each chapter's markdown lesson with a runnable .NET project and unit tests, without Python or notebooks.

This is a free ebook aimed at .NET developers who want to build real AI-powered applications in C#, without switching to Python or notebooks. Each chapter is a standalone Markdown file with embedded code snippets, backed by a runnable .NET project in that chapter's source folder and unit tests covering the chapter's code patterns.

Seven completed chapters cover the .NET AI landscape and cost spectrum, setting up a dev environment with LM Studio, GGUF quantization, Microsoft.Extensions.AI, OpenAI and Azure AI Foundry, enough LLM theory to be useful, tokens, context windows, temperature and IChatClient, the anatomy of a prompt with a fluent PromptBuilder class, core prompting techniques such as zero-shot, few-shot, chain-of-thought, self-consistency and rubric-based prompting, structured JSON output with defensive parsing and streaming, and prompt patterns for real developer workflows such as code review, test generation, commit messages and documentation.

Built with C# and .NET 10, requiring either a local LM Studio install or an OpenAI or Azure API key; also available for download on Leanpub.

Website: https://leanpub.com/promptengineeringfornetdevelopers
