Example #1
0
        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));
        }
Example #2
0
 public Collector(SerializerCache serializerCache)
 {
     SerializerCache = serializerCache;
 }