Skip to content

Karol memo

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

  • Blog
  • About
  • Contact

Monthly Archives: October 2020

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

    Have a WordPress.com account? Log in now.

  • Karol memo
    View site in Reader
    Manage subscriptionsSign upLog in
    Report this content
    Collapse this bar