public static void RegisterType(Type type, WritingDelegate writingMethod, ReadingDelegate readingMethod) { if (_handlers.ContainsKey(type)) { throw new ArgumentException($"There is already a registration for type {type.FullName}."); } _handlers.Add(type, new Handler(writingMethod, readingMethod)); }
public Handler(WritingDelegate writingMethod, ReadingDelegate readingMethod) { this.writingMethod = writingMethod; this.readingMethod = readingMethod; }