I’ve got an enum defined in one of my Enum.cs classes inside this project where these interfaces lie.
I’ve got an Interface called IPhoto and in it I need to put a property called FileType because other methods in this service expect it so I want any class implementing IPhoto to have this defined so they know about it.
Does this seem out of place or you just wouldn’t do such a thing? How would I define this then?
I mean I can’t just do this:
MyEnum FileType;
The thing is all files have a type. And in my concrete classes I signal that using an Enum (so jpeg, etc.). So any class implementing this needs to definitely have a FileType property somehow.
You can add a property to an interface. See the docs.
Now all implementations of the interface have to define a getter for that property.