© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
9 replies
reeeeeee

Interface that is implemented to multiple classes (different types of objects)

Method in class1:
public Employee CreateEmployee(EmployeeCreateModel1 model) { .... }
public Employee CreateEmployee(EmployeeCreateModel1 model) { .... }


Method in class2:
public Employee CreateEmployee(EmployeeCreateModel2 model) { .... }
public Employee CreateEmployee(EmployeeCreateModel2 model) { .... }


How could I create interface that would be used for both of them..
public interface EmployeeService {
  Employee CreateEmployee(??? createmodel);
}
public interface EmployeeService {
  Employee CreateEmployee(??? createmodel);
}

Any idea/advice?
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

Same UpdateDatabase method for multiple types of objects
C#CC# / help
4y ago
Collection of different classes
C#CC# / help
4y ago
Creating a interface for a template engine for multiple different types
C#CC# / help
4y ago
❔ Classes and objects
C#CC# / help
3y ago