Skip to content

Karol memo

IT, dev, C#, .NET, advices, problems and nutshell solutions

  • Blog
  • About
  • Contact

Tag Archives: FileResult

FileResult in controller and returning NotFound

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:

Posted byKarolOctober 31, 2020October 31, 2020Posted in.NET, C#, dev, IT, programmingTags:ActionResult, FileResult, NotFoundLeave a comment on FileResult in controller and returning NotFound
  • Blog
  • About
  • Contact
Karol memo, Create a website or blog at WordPress.com
  • Subscribe Subscribed
    • Karol memo
    • Already have a WordPress.com account? Log in now.
    • Karol memo
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar