Releases: soundaranbu/Razor.Templating.Core
Releases · soundaranbu/Razor.Templating.Core
v2.1.0
What's Changed
- Same changes as v2.1.0-rc.1
NuGet
https://www.nuget.org/packages/Razor.Templating.Core/2.1.0
Full Changelog: v2.0.0...v2.1.0
v2.1.0-rc.1
What's Changed
- #72 Fixed an issue in the MVC application where views were not being discovered in the same controller’s view location. Now, if the controller is HomeController and the view file Index.cshtml is located under Views/Home/Index.cshtml, the library can render the view from HomeController simply by passing Index as the view name. Previously, it was necessary to pass the full relative URL Views/Home/Index.cshtml. This functionality is available only when IRazorTemplateEngine is utilized through Dependency Injection (DI). For applications that are not MVC-based, this view discovery method will not work, and the library will revert to the default behavior, which requires the full relative path of the view file.
- #71 Adds support for MVC View localization
NuGet
https://www.nuget.org/packages/Razor.Templating.Core/2.1.0-rc.1
Full Changelog: v2.0.0...v2.1.0-rc.1
v2.0.0
v2.0.0-rc.1
What's Changed
- New methods to render if view not exists by @soundaranbu in #66
+ Task<(bool ViewExists, string? RenderedView)> TryRenderAsync(string viewName, object? viewModel = null, Dictionary<string, object>? viewBagOrViewData = null);
+ Task<(bool ViewExists, string? RenderedView)> TryRenderPartialAsync(string viewName, object? viewModel = null, Dictionary<string, object>? viewBagOrViewData = null);
Breaking Change
- Removed deprecated methods announced in the previous releases
// This method can be safely removed and it has no effect
- Initialize()
// Use the non-generic variant instead
- Task<string> RenderAsync<TModel>(string viewName, object viewModel, Dictionary<string, object> viewBagOrViewData)
NuGet
Full Changelog: v1.9.0...v2.0.0-rc.1
v1.9.0
What's Changed
- Added option to RenderPartialAsync when you don't need a layout page … by @mobiletonster in #52
- Do not override IWebHostEnvironment when it's already present #58
New Contributors
- @mobiletonster made their first contribution in #52
NuGet
Full Changelog: v1.8.0...v1.9.0
v.1.9.0-rc.2
What's Changed
- #58 Do not override
IWebHostEnvironment
when it's already present - Full Changelog: v1.9.0-rc.1...v.1.9.0-rc.2
NuGet
v.1.9.0-rc.1
What's Changed
- Added method
RenderPartialAsync
when you don't need a layout page … by @mobiletonster in #52
New Contributors
- @mobiletonster made their first contribution in #52
Full Changelog: v1.8.0...v1.9.0-rc.1
NuGet
v1.8.0
What's Changed
- All changes described in https://github.com/soundaranbu/Razor.Templating.Core/releases/tag/v1.8.0-rc.1
New Contributors
Full Changelog: v1.7.1...v1.8.0
NuGet Package
v1.8.0-rc.1
NuGet
- This version is published in NuGet as prerelease https://www.nuget.org/packages/Razor.Templating.Core/1.8.0-rc.1
What's Changed
- Add
IRazorTemplateEngine
interface & allow dependency injection through constructor by @pbolduc in #48
public interface IRazorTemplateEngine
{
/// <summary>
/// Renders View(.cshtml) To String
/// </summary>
/// <param name="viewName">Relative path of the .cshtml view. Eg: /Views/YourView.cshtml or ~/Views/YourView.cshtml</param>
/// <param name="viewModel">Optional model data</param>
/// <param name="viewBagOrViewData">Optional view bag or view data</param>
/// <returns></returns>
Task<string> RenderAsync(string viewName, object? viewModel = null, Dictionary<string, object>? viewBagOrViewData = null);
}
- #46 Fixed issue with thread safely by @pbolduc in #48
- #25 Fixed issue with DI in Blazor Server project by @pbolduc in #48
- #39 Reduced 3 APIs into 1 API. ViewModel, ViewBagOrViewData are now optional params by @pbolduc in #48
Task<string> RenderAsync(string viewName, object? viewModel = null, Dictionary<string, object>? viewBagOrViewData = null);
What's Obsolete
RazorTemplateEngine.Initialize()
is not used anymore and hence is marked as obsolete. Users can safely remove it. This method will be removed in v2.0.0- The
RenderAsync
method with generic type is not used anymore. Users will need to use the alternateRenderAsync
method without a generic type param. This API with generic type param will be removed in v2.0.0
//before
var html = await RazorTemplateEngine.RenderAsync<object>("~/Index.cshtml", null, viewData);
//after
var html = await RazorTemplateEngine.RenderAsync("~/Index.cshtml", null, viewData);
New Contributors
Full Changelog: v1.7.1...v1.8.0-rc.1
v1.7.1
What's Changed
- Template engine loads assemblies multiple times and breaks resolution of XAML resources by @dirvo in #37
- Added sample to send emails with razor templating by @soundaranbu in #43
- Improved documentation in README.md
- Tests cases are now aligned with
v1.6.x
- Published NuGet Package https://www.nuget.org/packages/Razor.Templating.Core/1.7.1
New Contributors
Full Changelog: v1.7.0...v1.7.1