using System; using System.Collections.Generic; using System.Linq; namespace Fixtures { public class Person { public int Id { get; set; } public string Name { get; set; } public string Email { get; set; } public Person(int id, string name, string email) { Id = id; Name = name; Email = email; } public override string ToString() { return $"{Name} <{Email}>"; } } public class Repository { private readonly Dictionary _items = new(); public void Add(int key, T item) { _items[key] = item; } public T? Find(int key) { return _items.TryGetValue(key, out var item) ? item : default; } public IEnumerable GetAll() { return _items.Values.ToList(); } } public static class Helpers { public static int Add(int a, int b) => a + b; public static IEnumerable Filter(IEnumerable items, Func predicate) { return items.Where(predicate); } } public class Program { public static void Main(string[] args) { var repo = new Repository(); repo.Add(1, new Person(1, "Alice", "alice@example.com")); repo.Add(2, new Person(2, "Bob", "bob@example.com")); var active = repo.GetAll(); foreach (var p in active) { Console.WriteLine(p); } Console.WriteLine($"3 + 4 = {Helpers.Add(3, 4)}"); } } }