I have this method in my controller.
public IActionResult Download()
{
return Json(_context.Users);
}
I noticed that it produces the correct JSON structure but it's being rendered in the browser as common text. I want it to be downloaded to the client's computer. How do I do that?
I'm not sure if is should make my object to stream somehow like this or maybe create a file on my hard drive and serve it like this.
I can't find anything that strikes me as straight-forward and simple like we're used to in C#. So I fear that I'm missing a concept here.