Is it possible in C# (and I think it’s not) to extend int to implement an interface (without creating a wrapper class)?
I have an interface like so
public interface IActionLoggerObject
{
string GetForLogging();
}
I would like to (conceptually) be able to do this:
public class int:IActionLoggerObject
{
string IActionLoggerObject.GetForLogging() { return "s"; }
}
No. You can never change which interfaces an existing type implements.
It’s not clear why you’re trying to do so, but creating a wrapper class is almost certainly the way forward here.