IJsonEncoder.cs 727 B

123456789101112131415161718192021222324
  1. #if !BESTHTTP_DISABLE_SIGNALR
  2. using System.Collections.Generic;
  3. namespace BestHTTP.SignalR.JsonEncoders
  4. {
  5. /// <summary>
  6. /// Interface to be able to write custom Json encoders/decoders.
  7. /// </summary>
  8. public interface IJsonEncoder
  9. {
  10. /// <summary>
  11. /// This function must create a json formatted string from the given object. If the encoding fails, it should return null.
  12. /// </summary>
  13. string Encode(object obj);
  14. /// <summary>
  15. /// This function must create a dictionary the Json formatted string parameter. If the decoding fails, it should return null.
  16. /// </summary>
  17. IDictionary<string, object> DecodeMessage(string json);
  18. }
  19. }
  20. #endif