title: Controller return type in Asp.Net Core API
body: <pre><code>    [HttpGet("{id}")]
      public Visitor Get(string id)
      {
          var result = _visitorRepository.GetFromDB(id);
  
          if (result == _visitorRepository.GetFromDB(id))
              return StatusCode(200);
          if (result != null)
              return result;
          else
              return StatusCode(408);
      }
  </code></pre>
  
  <p>It gives me an error because StatusCode has ActionResult return type</p>
  
  <pre><code>    [HttpGet("{id}")]
      public ActionResult Get(string id)
      {
          var result = _visitorRepository.GetFromDB(id);
  
          if (result == _visitorRepository.GetFromDB(id))
              return StatusCode(200);
          if (result != null)
              return result;
          else
              return StatusCode(408);
      }
  </code></pre>
  
  <p>It gives me an error because result has Visitor return type</p>
  
  <p>I need only one method but I cannot convert the returning type from ActionResult to visitor and vice versa.</p>