title: How to delete property from dynamic JObject programmatically
body: <p>Below is the code</p>
  <p>json - just want JsonLookupData in the response</p>
  <pre><code>{
    &quot;LookupType&quot;: &quot;ABC&quot;,
    &quot;BusSegmentName&quot;: &quot;Test&quot;,
    &quot;PolcyObjectId&quot;: &quot;999&quot;,
    &quot;JsonLookupData&quot;: {
      &quot;data&quot;:    {
        &quot;OBJ_ID&quot;: &quot;9393&quot;,
        &quot;ABC&quot;: &quot;JAJA&quot;,
        &quot;XYZ&quot;: &quot;LL&quot;,
        &quot;AAA&quot;: &quot;250.00&quot;
      }
    }
  }
  
  public new dynamic input { get; set; }
  
  //initialization 
   input = JsonConvert.DeserializeObject(jsonInput.ToString());
  
  //trying to remove all attributes except JsonLookupData
  input.Properties().Where
                   (x =&gt; !x.Name.Equals(&quot;JsonLookupData&quot;)).ToList().ForEach(x =&gt; x.Remove());
    
  </code></pre>
  <p>Is there any way to delete the properties directly from the dynamic <strong>input</strong> (Don't want to assign it to JObject first).</p>
  <p>above code is giving the below error</p>
  <pre><code>Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type
  </code></pre>