Serialize.Linq icon indicating copy to clipboard operation
Serialize.Linq copied to clipboard

bug when using expressions that contain dynamic

Open Slacquer opened this issue 5 years ago • 1 comments

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.

Slacquer avatar Oct 22 '20 18:10 Slacquer

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.

esskar avatar Dec 10 '20 22:12 esskar