Dear support,
I have a issue when try to update your lib from 2.3.1 to the latest version. My code is run in .net core 3.1/5.0
Here my test, if I use the 2.3.1 the function is OK, but upgrade it to newer versions, it always fail.
Could you check it for me?
`using System;
using fastJSON;
namespace Test
{
class Program
{
static void Main(string[] args)
{
var jsonObj = new ExtendMessage
{
Layer0 = LayerEnum.L0,
Layer1 = LayerEnum.L1,
Layer2 = LayerEnum.L2,
Layer3 = LayerEnum.L3,
Layer4 = LayerEnum.L4
};
//first try to parse this msg
var stringJson = JSON.ToJSON(jsonObj);
// and re-make the object with the base
var testParse = JSON.ToObject(stringJson);
// check the parser works
if (testParse is ExtendMessage)
{
var obj = testParse as ExtendMessage;
//check it have value
if (obj.Layer4 == LayerEnum.L4)
{
Console.WriteLine("OK");
}
else
{
// found issue in >>>>> HERE <<<<<
Console.WriteLine("FAIL:" + obj.Layer4);
}
}
else
{
Console.WriteLine("FAIL:" + stringJson);
}
Console.ReadLine();
}
}
public enum LayerEnum
{
NONE = 0,
L0 = 1,
L1 = 10,
L2 = 20,
L3 = 30,
L4 = 40
}
public class ExtendMessage : Message
{
public LayerEnum Layer4 { get; set; }
}
public class Message : BaseMessage
{
public LayerEnum Layer3 { get; set; }
}
public class BaseMessage : AbstractMessage
{
public LayerEnum Layer2 { get; set; }
}
public abstract class AbstractMessage
{
public LayerEnum Layer1 { get; set; }
public LayerEnum Layer0 { get; internal set; }
}
public interface IMessage
{
LayerEnum Layer0 { get; set; }
}
Dear support, I have a issue when try to update your lib from 2.3.1 to the latest version. My code is run in .net core 3.1/5.0
Here my test, if I use the 2.3.1 the function is OK, but upgrade it to newer versions, it always fail. Could you check it for me?
`using System; using fastJSON;
namespace Test { class Program { static void Main(string[] args) { var jsonObj = new ExtendMessage { Layer0 = LayerEnum.L0, Layer1 = LayerEnum.L1, Layer2 = LayerEnum.L2, Layer3 = LayerEnum.L3, Layer4 = LayerEnum.L4 }; //first try to parse this msg var stringJson = JSON.ToJSON(jsonObj); // and re-make the object with the base var testParse = JSON.ToObject(stringJson);
// check the parser works
if (testParse is ExtendMessage)
{
var obj = testParse as ExtendMessage;
//check it have value
if (obj.Layer4 == LayerEnum.L4)
{
Console.WriteLine("OK");
}
else
{
// found issue in >>>>> HERE <<<<<
Console.WriteLine("FAIL:" + obj.Layer4);
}
}
else
{
Console.WriteLine("FAIL:" + stringJson);
}
Console.ReadLine();
}
}
}`