I have some utility functions and Pagination function. I want to create classes named Utility and Pagination for these functions respectively, so that I can use these class function in more than one controllers.
So where can I put these class in my folder structure, and how can I access then?
You can either create a new Folder called
Helpersunder the root and keep your classes physically there. I would keep my classes under a different namespace calledHelpersTo accees this in my other classes (Ex : Controllers) ,I can either use the fully qualified name
OR
add a
Importstatement at the top so that i can skip the fully qualified nameIf you think your Helper method can be used in another project also, You may consider to keep them physically in a separate project(of type class library). To use this in your project, Add a reference to this project and use it like what we did above (use either fully qualified name or use import statement)