logo

Crowdly

Browser

Add to Chrome

Prod p = new Car { Wheels = 4 }; var opt = new JsonSerializerOptions { TypeInfoR...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Prod p = new Car { Wheels = 4 };

var opt = new JsonSerializerOptions { TypeInfoResolver = new DefaultJsonTypeInfoResolver() };

string js = JsonSerializer.Serialize<Prod>(p, opt);

System.Console.WriteLine(js.Contains("Car"));

[JsonPolymorphic] [JsonDerivedType(typeof(Car))] abstract class Prod { }

class Car : Prod { public int Wheels { get; set; } }

0%
0%
0%
100%
More questions like this

Want instant access to all verified answers on do.ipo.kpi.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome