Let's take a look at the following implementation of the generic interface as follows:
- Go ahead and create a generic interface called IListClassProperties<T>. The interface will define a method that needs to be used called GetPropertyList() that simply uses a LINQ query to return a List<string> object:
interface IListClassProperties<T> { List<string> GetPropertyList(); }
- Next, create a generic class called InspectClass<T>. Let the generic class implement the IListClassProperties<T> interface created in the previous step:
public class InspectClass<T> : IListClassProperties<T> { }
- As usual, Visual Studio will highlight that the interface member GetPropertyList() has not been implemented in the InspectClass<T>