๐ WAYPOINT LESSON
Checkpoint โ The Catalog Import/Export Engine
โญโญ intermediateโณ 25 min read๐ Lesson 131 of 265
Combine options, converters, and boundary defense into one round-trip-safe catalog service.
The gate (mini-build)
A product catalog exchange โ import, export, and transform:
Export(IEnumerable<Product> products)โ camelCase JSON array:[{"name":"bolt","price":0.5},...](name string, price number).Import(string json)โ products; tolerant of price as number OR string (via a custom converter); malformed JSON or a missing/empty name โInvalidOperationException("bad payload").Merge(string jsonA, string jsonB)โ union by name (first wins), exported asExportwould.
Product: record Product(string Name, decimal Price). Input JSON shape:
{"products":[{"name":"bolt","price":0.5}]}.