title: Can asp.net core (.net 5 ) web api controller redirect to web page
body: <p>since the .NET 5 web Api doesn't have a webpage or ui as such,
  can we do a  redirect to another webpage (<a href="http://somedomain.com/" rel="nofollow noreferrer">http://somedomain.com/</a>)
  Bit if i do the same in .net mvc it works fine .
  IF we cannt do a redirect from api what is the alternative ?</p>
  <p>Our requirement is to call web api , do some work inside that and redirect to web page</p>
  <p>Below code for .NET 5 web Api doesn't work</p>
  <pre><code>[Route(&quot;api/[controller]&quot;)]
  [ApiController]
  public class RedirectController : ControllerBase
  {
  
  [HttpGet]
      public IActionResult GetRedirect()
      {
          //Do some work
          return Redirect(&quot;http://somedomain.com/account?id=1234&amp;code=NEW&quot;);
      }
  
  }
  
  public class HomeController : Controller
  {
      private readonly ILogger&lt;HomeController&gt; _logger;
  
      public IActionResult Privacy()
      {
          //Do some work
          return Redirect(&quot;http://somedomain.com/account?id=1234&amp;code=NEW&quot;);
         
      }
   }
  </code></pre>