Back to directory

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.

Prompt Engineering for .NET Developers

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.

More in Tutorials

See all 478
  • BootLife

    github.com

    Conway's Game of Life implemented to run directly from a 512-byte x86 boot sector in assembly, using VGA memory itself as the simulation grid.

  • A technical blog post deriving the Y combinator as a composition of combinator birds in an array language, and examining how eager evaluation changes fixed-point recursion compared with the usual lazy telling.

  • System Design Atlas

    atlas-sysdes.vercel.app

    A free reference of worked system design problems with interactive architecture diagrams, covering ranked designs such as a feed, a chat app, a URL shortener, and a rate limiter, plus pages on the technologies behind them.