title: RavenDB: How to prevent $type being saved to a dynamic typed property?
body: <p>Is there a way to prevent a <code>$type</code> property being added when I save my dynamic type values?</p>
  
  <p>When I save this:</p>
  
  <pre><code>new Activity {
      Name = "FormFieldDeleted",
      Body =  new {
          MyDeletedFormField(),
          MyCompleteForm()
      }
  }
  </code></pre>
  
  <p>I get this</p>
  
  <pre><code>&lt;&gt;f__AnonymousType1`2[[MyProject.Domains.Forms.Models.FormField, MyProject.Domains.Forms],[MyProject.Domains.Forms.Entities.FormRegistration, MyProject.Domains.Forms]], MyProject.Api.Forms
  </code></pre>
  
  <p>But when I try to fetch this saved entity, it crashes with the exception below. I know it's missing a project reference, but I really don't want to add that reference (I don't want to reference an API from a console app). It's better for me to just prevent the <code>$type</code> property.</p>
  
  <pre><code>/usr/local/share/dotnet/dotnet path/MyProject/MyProject/src/MyProject.Tasks.MapActivities/bin/Debug/netcoreapp3.1/MyProject.Tasks.MapActivities.dll
  Unhandled exception. System.InvalidOperationException: Could not convert document 31317d58-db9e-4f60-8dee-b8593f3e06c0 to entity of type MyProject.Domains.Core.Entities.Activity
   ---&gt; Newtonsoft.Json.JsonSerializationException: Error resolving type specified in JSON '&lt;&gt;f__AnonymousType1`2[[MyProject.Domains.Forms.Models.FormField, MyProject.Domains.Forms],[MyProject.Domains.Forms.Entities.FormRegistration, MyProject.Domains.Forms]], MyProject.Api.Forms'. Path 'Body.$type'.
   ---&gt; Newtonsoft.Json.JsonSerializationException: Could not load assembly 'MyProject.Api.Forms'
  ....
  </code></pre>