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

Should DynamicLinq be used? #54

Closed
natelaff opened this issue Jun 11, 2022 · 4 comments
Closed

Should DynamicLinq be used? #54

natelaff opened this issue Jun 11, 2022 · 4 comments
Labels
question Further information is requested

Comments

@natelaff
Copy link

Is the DynamicLinq helper production ready? It's not mentioned in readme and in code it seems to hint that it's only for backcompat.

I was going to craft a helper similar to Select where it could check the value of an item in array. For instance, I need to iterate through a lookup array, and check a collection to see if it has a matching ID there. I thought maybe I could do this with the linq helper using Any() or something, but thought I'd check your thoughts!

An ifExists or ifIn helper might be a nice add. I am going to take a stab at it... not quite sure how to make that dynamic the way I need but... we'll figure it out maybe

@StefH StefH added the help wanted Extra attention is needed label Jun 15, 2022
@StefH
Copy link
Collaborator

StefH commented Jun 15, 2022

Handlebars.Net.Helpers.DynamicLinq can be used, I just did not have time yet to create/update the wiki

An ifExists or ifIn helper might be a nice add
Yes, you can create a PR.

@StefH StefH added question Further information is requested and removed help wanted Extra attention is needed labels Nov 23, 2022
@StefH
Copy link
Collaborator

StefH commented Mar 1, 2023

@natelaff

was going to craft a helper similar to Select where it could check the value of an item in array. For instance, I need to iterate through a lookup array, and check a collection to see if it has a matching ID there. I thought maybe I could do this with the linq helper using Any() or something, but thought I'd check your thoughts!

There is already a Enumerable helper for that : https://github.com/Handlebars-Net/Handlebars.Net.Helpers/wiki/Enumerable

But I also added more functionality to DynamicLinq. (#71) and ()#70.

I'll create a new NuGet including this logic.

And I did update the wiki a bit:
https://github.com/Handlebars-Net/Handlebars.Net.Helpers/wiki/DynamicLinq

@StefH StefH closed this as completed Mar 1, 2023
@natelaff
Copy link
Author

natelaff commented Mar 2, 2023

@StefH cool! I will give it a try. Enumerable didn't work with complex objects. So the thinking was it would need to take in a property name that it would check if that value exists in that member.

@StefH
Copy link
Collaborator

StefH commented Mar 2, 2023

@natelaff
you can test version 2.3.14-preview-03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants