title: Unable to detect changes for shadow properties in EF Core
body: <p>I'm trying to get changes for properties, but there is a problem with <a href="https://docs.microsoft.com/en-us/ef/core/modeling/shadow-properties" rel="nofollow noreferrer">shadow properties</a>, both <code>CurrentValue</code> and <code>OriginalValue</code> are null, is there any alternative for shadow properties?</p>
  <pre><code>var entities = _context
      .ChangeTracker
      .Entries()
      .ToArray();
  
  foreach (var entity in entities)
  {
      foreach (var property in entity.Properties)
      {
          if (property.Metadata.IsShadowProperty())
          {
              var newValue = property.CurrentValue;  // null
              var oldValue = property.OriginalValue; // null
          }
      }
  }
  </code></pre>
  <p>Entity Classes:</p>
  <pre><code>public class ParentEntity
  {
      public string Id { get; set; }
      public OwnedEntity SomeEntity { get; set; }
      private string _name;
  
      public ParentEntity(string id, string name)
      {
          Id = id;
          _name = name;
          SomeEntity = new OwnedEntity();
      }
  }
  
  public class OwnedEntity 
  {
      public string Id { get; set; }
      public string Name { get; set; }
  
      public OwnedEntity()
      {
          Id = Guid.NewGuid().ToString();
          Name = &quot;Some Name&quot;;
      }
  }
  </code></pre>
  <p>configuration:</p>
  <pre><code>public void Configure(EntityTypeBuilder&lt;ParentEntity&gt; builder)
  {
      builder.HasPartitionKey(x =&gt; x.PartitionKey);
  
      builder.Property(&quot;_name&quot;).ToJsonProperty(&quot;name&quot;);
      builder.Property(x =&gt; x.Id).ToJsonProperty(&quot;id&quot;);
  
      builder.OwnsOne(x =&gt; x.SomeEntity, x =&gt;
          {
              x.ToJsonProperty(&quot;someEntity&quot;);
              x.Property(x =&gt; x.Id).ToJsonProperty(&quot;id&quot;);
              x.Property(x =&gt; x.Name).ToJsonProperty(&quot;name&quot;);
          });
  
      builder.HasKey(x =&gt; x.Id);
  
      builder.HasDiscriminator();
  
      builder.ToContainer(&quot;container1&quot;);
  }
  </code></pre>