✅ Make method implemented in interface accessible from implementing type
i have an interface and an implementing struct
now
GetPlatforms()
isnt reachable via new CLAdapter().GetPlatforms()
, how can i make that accessible?
i tried implementing it in the adapter by simply casting this
to ICL
, but then i run into stack overflows 2 Replies
It's a default interface implementation, that's only seen on the interface, it's not part of the implementing class
var adapter = new CLAdapter();
adapter.GetPlatforms();
ICL castAdapter = adapter; castAdapter.GetPlatforms(); Second usage would work I'm actually not entirely sure how you would work around this, the SO exception is due to the function just calling itself on and on, but I never really work with default interface implementations, so not entirely sure how you would be able to redirect it to the DII
ICL castAdapter = adapter; castAdapter.GetPlatforms(); Second usage would work I'm actually not entirely sure how you would work around this, the SO exception is due to the function just calling itself on and on, but I never really work with default interface implementations, so not entirely sure how you would be able to redirect it to the DII
hmmm, guess ill have to do it differently 😒
thanks for ur help, thought i was missing something very simple here