Custom C# Classes
- 38 Downloads
Like the other C# classes we have discussed in this book, a custom C# class can contain properties, methods, and events. These classes are considered “custom” because the only properties, methods, and events they contain are the ones we define. Because of this, they do exactly what we want them to do—nothing more, nothing less. Custom C# classes are helpful when there are functions or procedures that we must perform in many places within a single Web application or across multiple Web applications. So, instead of writing a segment of code to perform a function or procedure and then copying that code to many places, we can write a single method within a custom C# class and then invoke that method as needed. This way, when a change to the logic of the code is required, we need only make the change in one place.