Repository navigation
Refine interface of Render - #8
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the
Rendermethod of theTemplateclass inminijinja/Environment.csto 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 genericobject?with overloads forIDictionary<string, Value>,IDictionary<string, object?>, andITemplateSerializable. 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
Template.Rendermethod to provide overloads forIDictionary<string, Value>,IDictionary<string, object?>, andITemplateSerializable, replacing the previous single method that accepted a genericobject?and a helper for context conversion. This improves type safety and clarity for users. [1] [2]Test updates
Render()overload when no context is provided, replacing calls toRender(null)for clarity and consistency with the new API. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23]Minor code cleanup
using System;directive at the top ofminijinja/Environment.csfor completeness.