Search code examples
c#enumsinterface

How to represent an Enum in an Interface?


How could I define an Interface which has a method that has Enum as a paramater when enums cannot be defined in an interface?

For an Enum is not a reference type so an Object type cannot be used as the type for the incoming param, so how then?


Solution

  • interface MyInterface
    {
        void MyMethod(Enum @enum);
    }