© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
3 replies
Warchortle

Creating a interface for a template engine for multiple different types

I created a very basic template engine to scan a string for a token and replace it. I am struggling to come up with an interface that can be used by various types to define what properties in it need to be passed through the template engine.

The idea was to create a base class that any object could inherit from and by calling a method on that class all of the string properties(or all the defined string properties) could be run through the template engine. But I cant find a good way to do that.

I looked into using reflection but wasn't able to get the value of the property. Any ideas on how to implement this, or on another approach.
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 that is implemented to multiple classes (different types of objects)
C#CC# / help
4y ago
Creating a template
C#CC# / help
3y ago
WPF TreeListView bind multiple different node object types
C#CC# / help
2y ago
✅ Invalid cast between interface types
C#CC# / help
4y ago