public static TypeConfig Engine <T>(this TypeConfig config, Func <Json, T> deserialize, Func <T, Json> serialize) { if (deserialize == null || serialize == null) { return(config); } return(config.Engine((t, j) => deserialize(j).AssertCast <T>(), (t, o) => serialize(o.AssertCast <T>()))); }