© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•12mo ago•
13 replies
bingham

Interface practices

Apologies for the dumb question, I've been out of C# for more than a decade, and I have the unenviable task of porting some template-heavy C++ code to C#. My googling has failed to get results because I'd call what I want to do "delegation", and, well, that name is already taken...

Anyway, I've got a class that has C++ multiple inheritance, and I need to reproduce the functionality in C#. So, I add an interface to (at least one) base class, have the derived class derive from the interface, and add a field to the derived class containing the implementation of the interface.

My question is -- is there a way to tell the compiler "refer this interface to this field that implements the interface" as a single... operation? concept? without writing out stubs for all methods in the interface?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

interface
C#CC# / help
3y ago
❔ interface
C#CC# / help
4y ago
Interface
C#CC# / help
4y ago
Interface
C#CC# / help
4y ago