Skip to content

Add a JsonConverter.Type property. #63898

@bobbyangers

Description

@bobbyangers

EDIT see #63898 (comment) for an API proposal

Original Proposal

Description

internal sealed override Type TypeToConvert => typeof(T);

Error CS0122 'JsonConverter.TypeToConvert' is inaccessible due to its protection level CustomJsonStringEnumConverter.cs

Reproduction Steps

public class MyConverter : JsonConverter<T>

     private void SomeLogic()
     {
            this.TypeToCovert ///Do Something
     }

Expected behavior

This property should be accessible to derived classes

protected internal sealed override Type TypeToConvert => typeof(T);

Actual behavior

Error CS0122 'JsonConverter.TypeToConvert' is inaccessible due to its protection level CustomJsonStringEnumConverter.cs

Regression?

No response

Known Workarounds

Define my own copy of the method in the derived class.

Configuration

No response

Other information

No response

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions