AdminLogConverter.cs 645 B

1234567891011121314151617181920212223
  1. using System.Text.Json;
  2. using System.Text.Json.Serialization;
  3. namespace Content.Server.Administration.Logs.Converters;
  4. public interface IAdminLogConverter
  5. {
  6. void Init(IDependencyCollection dependencies);
  7. }
  8. public abstract class AdminLogConverter<T> : JsonConverter<T>, IAdminLogConverter
  9. {
  10. public virtual void Init(IDependencyCollection dependencies)
  11. {
  12. }
  13. public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
  14. {
  15. throw new NotSupportedException();
  16. }
  17. public abstract override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options);
  18. }