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.

Updated

Cheat sheet: Factory Method
Category
C#
Level
Journeyman
Tags
c-sharp, Factory Method, Factory Pattern, OOP