bug when using expressions that contain dynamic
Hello, great code, but there is a problem that i can not seem to figure out how to deal with.
// This works fine. Expression<Func<SomeModel, SomeResponse>> d = f => new SomeResponse{Foo=1};
// This causes a 'Couldnt not serialize dynamic`2 error, when DESERIALIZING Expression<Func<SomeModel, dynamic>> d = f => new {Foo=1};
// IE: var es = new ExpressionSerializer(new JsonSerializer()); //es.AddKnownType(typeof(dynamic)); var q= es.DeserializeText(select); // this was created using the serilize method, and serialized fine, just cant deserialize.
Thanks for the report. The problem is, that the deserializing side does not know that specific dynamic type. dynamic types are internal types that are dynamically created. as of right know, unknown type are not yet supported.