Serializable の属性を持つオブジェクトがあります。このクラスは、インターフェイスから継承する Serializable も継承する他のクラスから継承する抽象クラスから継承します
利用した
string included = JsonConvert.SerializeObject(msg,
Formatting.Indented,
new JsonSerializerSettings { /*ContractResolver = new NotificationPropertyResolver()*/ TypeNameHandling = TypeNameHandling.All});
msg は SignalR でこのオブジェクトを送信したいインターフェイスであるため、メンバーを無視していないことがわかります。インターフェイスとクラスを装飾しました
その解決策はありますか?私は自分の属性でリゾルバーも使用しようとしましたが、それでも同じ結果です
クラスは大きすぎますが...
[Serializable]
[WebAPINotification(Type = typeof(CSensor), Group = "Sensor")]
public class SensorsStateModeNotification : SensorNotification, IBPMPackagedNotification
public abstract class SensorNotification : BasicLanNotification, ISensNotification
[Serializable]
public class BasicLanNotification : BasicNotification, ILanNotification
[Serializable]
public abstract class BasicNotification : INotification, ISerializable, IOpSerializable
[JsonIgnore]
public long SentAt
{
get
{
return m_sentAt;
}
set
{
m_sentAt = value;
}
}
/// <summary>
///
/// </summary>
[JsonIgnore]
public ENotificationGateway NotificationGateway
{
get
{
return m_NotifyGateway;
}
set
{
m_NotifyGateway = value;
}
}