© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•7mo ago•
8 replies
Myrcin

Design

Hi everyone. I've got a design problem to solve. I want to be able to create separate Task classes that would be resolved by TaskService class which would store the tasks in a database when executed. The TaskService class would invoke Execute method and somehow determine which task to run (I'm thinking either enum or type). so that is simple enough, but I want this to be a library that would have intellisense for others to use: so I'm looking for a solution when someone enters _taskService.Execute(<enum>) they know what parameters to pass and what is the return value. I tried generics in the following way: _taskService.Execute<TInput, TOutput>(<enum, parameters), but in this way the user has to know what input and return value to specify instead of having intellisense. Would the only way be to create a registry with the tasks and give each one of them a method like: _taskRegistry.ExecuteTaskEmail(string email)? looking for any help to write a nice extensible task service library with intellisense. Thanks
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

Design
C#CC# / help
4y ago
Help needed with design design
C#CC# / help
2y ago
design question
C#CC# / help
2mo ago
Database Design
C#CC# / help
7mo ago