title: JsonSerializer behaves not as expected when the specifc class is casted to something else
body: <p>Im trying to migrate from json.net to microsoft's json and found something that behaves very differently.</p>
  
  <p>Let's use this simplified example:</p>
  
  <pre><code>public interface IName
  {
      string Name { get; set; }
  
  }
  
  public class Person : IName
  {
      public string Name { get; set; }
      public int Age { get; set; }
  }
  
  public void Foo() 
  {
     IName p = new Person {Age = 4, Name = "Waldo"};
     var s1 = System.Text.Json.JsonSerializer.Serialize(p); // --&gt; {"Name":"Waldo"}
     var s2 = Newtonsoft.Json.JsonConvert.SerializeObject(p); // --&gt; {"Name":"Waldo","Age":4}
  }
  </code></pre>
  
  <p>Microsoft's Serializers serializes properties from  IName
  JSON.NET serializes properties from Person</p>
  
  <p>Is there a way to configure it so that it would work like JSON.NET? The options that I could pass do not indicate that this is configurable. Did I overlook something? </p>