In MVC, for example I have 5 different controller files. In all of them I have a method for saving an image. Is there a way to put this method on one place and every controller method to access it, instead of writing it in every controller? I tried
MyController.MyMethod();
But the Intellisence isn't showing it after I write the dot.
Put it in a utility class and make it static. From your controllers all you need to do is something like:
Utility.SaveImage(...);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With