IEnumerable, ISaveable, IDontGetIt: Understanding C# Interfaces
Contents
This repository contains slides and code samples for a presentation on C# interfaces using .NET 5.0. All samples build/run on Windows and many build/run on macOS and Linux (see below for details).
Topic Overview
We all want code that is easy to maintain, extend, and test. C# interfaces are here to help. We’ll take a look at how we can use interfaces effectively in our code, starting at the beginning ("What are interfaces?") and then exploring why we want to use them. Along the way we'll use existing interfaces, implement own interfaces, and take a look at dynamic loading, unit testing, and dependency injection. All of which is made easier with interfaces.
Sample Code
- desktop
Contains samples that use a WPF desktop UI (Windows only). - console
Contains samples that use console applications for the UI (Windows, macOS, Linux) - web
Contains samples that use a web UI (Windows, macOS, Linux)
Additional Resources