public DataResultMessage(string id, IReadOnlyQueryResult payload) : base( MessageTypes.Subscription.Data, id, payload.ToDictionary()) { }
public Task SerializeAsync( IReadOnlyQueryResult result, Stream stream) { if (result is null) { throw new ArgumentNullException(nameof(result)); } if (stream is null) { throw new ArgumentNullException(nameof(stream)); } IReadOnlyDictionary <string, object> dict = result.ToDictionary(); string json = JsonConvert.SerializeObject(dict); byte[] buffer = _encoding.GetBytes(json); return(stream.WriteAsync(buffer, 0, buffer.Length)); }
public IReadOnlyDictionary <string, object> ToDictionary() => _queryResult.ToDictionary();