title: Get a Value from ActionResult<object> in a ASP.Net Core API Method
body: <p>I try to get a value from <code>ActionResult&lt;object&gt;</code> in an ASP.NET Core API method. </p>
  
  <p>The API has a different controller. I try to use a method from controller B in controller A to return the result value. I get an <code>ActionResult</code> object from controller B. I can see the value with the debugger in the <code>ResultObject</code> but how can I get access to the result value in it?</p>
  
  <pre><code>public ActionResult&lt;object&gt; getSourceRowCounter(string sourcePath) //Method from Controller A
  {
      var result = ControllerB.GetValue($"{sourcePath}.{rowCounterVariableName}");  
      var result2 = result.Value; //null
      var result3 = result.Result; //typ: {Microsoft.AspNetCore.Mvc.OkObjectResult} &lt;-see Value=4 in it with Debugger
      //var result4 = result3.Value; //Error?!
      //var result5 = result3.Content; //Error?!
      //var result6 = result3.?????; //How can i get the Value = 4?
      return Ok(result); //should only return value 4 and not the whole object
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/4Lppi.jpg" alt="enter image description here"></p>