Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method overloading #31

Open
feelgood-interface opened this issue Aug 10, 2022 · 1 comment
Open

Method overloading #31

feelgood-interface opened this issue Aug 10, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@feelgood-interface
Copy link

feelgood-interface commented Aug 10, 2022

Good day,
is it possible to overload the helper method? I am trying to have a common helper method name (i.e. join) to join different type of lists.
The following code gives a sample on what I want to achieve. However, in this case the List<int> method is replaced after the second Register().

var helpers = new Helpers()
	.Register("join", (HelperContext context, List<int> list, string seperator) => string.Join(seperator, list))
	.Register("join", (HelperContext context, List<string> list, string seperator) => string.Join(seperator, list);
@Romanx
Copy link
Contributor

Romanx commented Aug 11, 2022

Hi there,

Thanks for opening the request. This sounds like a feature we could support. Let me take a look and see the complexity for supporting this

@Romanx Romanx self-assigned this Aug 11, 2022
@Romanx Romanx added the enhancement New feature or request label Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants