Skip to content

Instantly share code, notes, and snippets.

View HamidMolareza's full-sized avatar

Hamid Molareza HamidMolareza

View GitHub Profile
@HamidMolareza
HamidMolareza / Factory.cs
Created December 3, 2024 09:23
Factory Design Pattern example in C# for exporting Person data to JSON or text formats with flexible factory implementation.
using System.Text.Json;
// Client Code
public static class Program {
public static void Main() {
// Sample Data
var people = new List<Person> {
new("John", "Doe"),
new("Jane", "Smith"),
new("Alice", "Johnson")