IJsonSerializer.cs 851 B

123456789101112131415161718192021222324
  1. namespace Jwt
  2. {
  3. /// <summary>
  4. /// Specifies a contract for a JSON serializer implementation.
  5. /// </summary>
  6. public interface IJsonSerializer
  7. {
  8. /// <summary>
  9. /// Serializes an object to a JSON string.
  10. /// </summary>
  11. /// <param name="value">The value to serialize.</param>
  12. /// <returns>A JSON string representing of the object.</returns>
  13. string Serialize(object value);
  14. /// <summary>
  15. /// Deserializes a JSON string to a typed object of type <typeparamref name="T"/>.
  16. /// </summary>
  17. /// <typeparam name="T">The type of the object.</typeparam>
  18. /// <param name="value">A JSON string representing the object.</param>
  19. /// <returns>A typed object of type <typeparamref name="T"/>.</returns>
  20. T Deserialize<T>(string value);
  21. }
  22. }