|
|
@ -2,8 +2,6 @@ |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Text; |
|
|
|
using System.Text.Json; |
|
|
|
using System.Text.Json.Serialization; |
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
namespace X1.WebSocket.Models |
|
|
@ -76,18 +74,10 @@ namespace X1.WebSocket.Models |
|
|
|
public IEnumerable<string>? MessageDetail |
|
|
|
{ |
|
|
|
get => !string.IsNullOrEmpty(MessageDetailJson) |
|
|
|
? JsonSerializer.Deserialize<IEnumerable<string>>(MessageDetailJson, new JsonSerializerOptions |
|
|
|
{ |
|
|
|
PropertyNameCaseInsensitive = true, |
|
|
|
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull |
|
|
|
}) |
|
|
|
? Newtonsoft.Json.JsonConvert.DeserializeObject<IEnumerable<string>>(MessageDetailJson) |
|
|
|
: null; |
|
|
|
set => MessageDetailJson = value != null |
|
|
|
? JsonSerializer.Serialize(value, new JsonSerializerOptions |
|
|
|
{ |
|
|
|
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, |
|
|
|
WriteIndented = true |
|
|
|
}) |
|
|
|
? Newtonsoft.Json.JsonConvert.SerializeObject(value) |
|
|
|
: null; |
|
|
|
} |
|
|
|
|
|
|
|