# Factory Method

A factory method makes an object for you, so the code that uses it doesn't name the class it gets. A simple factory picks the class in one switch, instead of in every caller; the Gang of Four's Factory Method lets each subclass decide what to create. ASP.NET Core's registrations with a lambda are factories too.

![Cheat sheet: Factory Method](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/16941e94df844382b85d569c50969b68.webp)

- Category: C#
- Level: Journeyman
- Tags: c-sharp, Factory Method, Factory Pattern, OOP
- Updated: November 3, 2026

Source: https://www.ask-codey.com/cheat-sheets/design-patterns-factory-method-cheat-sheet
