Skip to content

IQueryable<T> support in for loops#383

Merged
xoofx merged 4 commits intoscriban:masterfrom
JvanderStad:feature/queryable-support
Oct 7, 2021
Merged

IQueryable<T> support in for loops#383
xoofx merged 4 commits intoscriban:masterfrom
JvanderStad:feature/queryable-support

Conversation

@JvanderStad
Copy link
Copy Markdown
Contributor

@JvanderStad JvanderStad commented Oct 7, 2021

Hi Alexandre,

I have added support for IQueryable<T> in for loops with supporting unit tests.

4.1.0 (7 October 2021)

  • Add IQueryable<T> support in for-loops.
    • Parameter offset:count will be translated to IQueryable<T>.Skip(count)
    • Parameter reversed will be translated to IQueryable<T>.Reverse()
    • Parameter limit:count will be translated to IQueryable<T>.Take(count)
    • Special for loop variables are supported with the exception of rindex and last
    • Optional LoopLimitQueryable-property on TemplateContext object to control looplimit in case of IQueryable (defaults to LoopLimit)

👋 Cheers

Comment thread src/Scriban/ScribanAsync.generated.cs
@xoofx xoofx merged commit 4bb867b into scriban:master Oct 7, 2021
@xoofx
Copy link
Copy Markdown
Member

xoofx commented Oct 7, 2021

Great work! Thank you!

@JvanderStad JvanderStad deleted the feature/queryable-support branch October 7, 2021 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants