We are developing a c# api project. We want to serialize a class with 3 properties but this class has 10 properties inside it. How can i create and convert json this class with 3 properties ? I want to generate a json string with this 3 property.
public class SampleClass
{
public string Prop1 { get; set; }
public string Prop2 { get; set; }
public string Prop3 { get; set; }
public string Prop4 { get; set; }
public string Prop5 { get; set; }
public string Prop6 { get; set; }
public string Prop7 { get; set; }
public string Prop8 { get; set; }
public string Prop9 { get; set; }
public string Prop10 { get; set; }
}
var myObj = new MyClass
{
Prop1 = "Value 1",
Prop2 = "Value 2",
Prop3 = "Value 3"
};