public (SerializerCache, Func <object, Collector, Fact>) GetSerializer(Type type) { SerializerCache after = this; if (!serializerByType.TryGetValue(type, out var serializer)) { serializer = Serialize(type).Compile(); after = new SerializerCache(serializerByType.Add(type, serializer)); } return(after, (fact, collector) => (Fact)serializer.DynamicInvoke(fact, collector)); }
public Collector(SerializerCache serializerCache) { SerializerCache = serializerCache; }