Return NotFound() in FileResult. Just change return type to ActionResult, because FileResult inherits from ActionResult. And then it is possible to return NotFound() e.g. when object equals null. So FileResult -> ActionResult, something like this:
IT, dev, C#, .NET, blockchain, smart contracts, advices, problems and nutshell solutions
Return NotFound() in FileResult. Just change return type to ActionResult, because FileResult inherits from ActionResult. And then it is possible to return NotFound() e.g. when object equals null. So FileResult -> ActionResult, something like this: