Implementing interfaces
Interfaces are a way of connecting different types together to make new things. Think of them like the studs on top of LEGO bricks that allow them to "stick" together, or electrical standards for plugs and sockets.
If a type implements a particular interface, then it is making a promise to the rest of .NET that it supports a certain feature.
Common interfaces
Here are some common interfaces that your types might want to implement:
Interface |
Method(s) |
Description |
---|---|---|
|
|
This defines a comparison method that a type implements to order or sort its instances |
|
|
This defines a comparison method that a secondary type implements to order or sort instances of a primary type |
|
|
This defines a disposal method to release unmanaged resources more efficiently than waiting for a finalizer |
|
|
This defines a culture-aware method to format the value... |