Closed
Description
I come from .net core 2.1 and after migration to .net 6 i got different behavior.
I have json in my RabbitMQ. After cunsume new message i deserialize to class with field List
class msg{
public string Name {get;set;}
public int Old {get;set;}
... other fiedls
public List<dynamic> list {get;set;}
}
Working code from 2.1 now throw error
foreach (var i in msg.list)
{
switch ((VariantEnum)i.variant)
In debug i found that now "var i" is typeof JsonElement
How i can in .net 6 use dynamic like before ?