8000 Refine interface of Render by fallenwood · Pull Request #8 · fallenwood/minijinja-csharp · GitHub
[go: up one dir, main page]

Skip to content

Refine interface of Render - #8

Merged
fallenwood merged 1 commit into
masterfrom
override
Jan 26, 2026
Merged

fallenwood merged 1 commit into
masterfrom
override

Conversation

@fallenwood
Copy link
Copy Markdown
Owner

This pull request refactors the Render method of the Template class in minijinja/Environment.cs to provide more type-safe and flexible overloads for rendering templates with different types of context objects. It replaces the previous single method that accepted a generic object? with overloads for IDictionary<string, Value>, IDictionary<string, object?>, and ITemplateSerializable. This change simplifies usage and improves clarity in both the implementation and the tests. All test cases are updated to use the new overload for rendering templates without context.

Template rendering API refactor

  • Refactored the Template.Render method to provide overloads for IDictionary<string, Value>, IDictionary<string, object?>, and ITemplateSerializable, replacing the previous single method that accepted a generic object? and a helper for context conversion. This improves type safety and clarity for users. [1] [2]

Test updates

Minor code cleanup

  • Added a missing using System; directive at the top of minijinja/Environment.cs for completeness.

@fallenwood
fallenwood merged commit 6cd7622 into master Jan 26, 2026
1 check passed
@fallenwood
fallenwood deleted the override branch January 26, 2026 10:19
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.

1 participant

0