How to write Implicit Conversion from an Interface to another type?
问题 I am trying to do something like below: public class SomeWrapper : ISomeWrapper{ public static implicit operator ActualRec(ISomeWrapper someWrapper) { return ((SomeWrapper)someWrapper).SomeInfo; } } But this code fails, saying: "Either parameter or return type must be of type SomeWrapper". I Understand the problem that compiling is stating. But I need this type conversionb because throughout my application I am using ISomeWrapper as the variable, storing SomeWrapper instance. (Also,