Skip to content

Releases: soundaranbu/Razor.Templating.Core

v2.1.0

14 Oct 21:13
Compare
Choose a tag to compare

v2.1.0-rc.1

12 Sep 19:38
Compare
Choose a tag to compare
v2.1.0-rc.1 Pre-release
Pre-release

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

18 Apr 08:44
Compare
Choose a tag to compare

v2.0.0-rc.1

04 Mar 22:20
d7d0c84
Compare
Choose a tag to compare
v2.0.0-rc.1 Pre-release
Pre-release

What's Changed

+ 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

25 Aug 23:31
Compare
Choose a tag to compare

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

NuGet

Full Changelog: v1.8.0...v1.9.0

v.1.9.0-rc.2

25 Feb 19:15
Compare
Choose a tag to compare
v.1.9.0-rc.2 Pre-release
Pre-release

What's Changed

NuGet

v.1.9.0-rc.1

13 Nov 15:19
Compare
Choose a tag to compare
v.1.9.0-rc.1 Pre-release
Pre-release

What's Changed

  • Added method RenderPartialAsync when you don't need a layout page … by @mobiletonster in #52

New Contributors

Full Changelog: v1.8.0...v1.9.0-rc.1

NuGet

v1.8.0

05 Nov 13:57
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.7.1...v1.8.0

NuGet Package

v1.8.0-rc.1

18 Sep 04:34
5bf86cc
Compare
Choose a tag to compare
v1.8.0-rc.1 Pre-release
Pre-release

NuGet

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 alternate RenderAsync 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

02 Jul 15:18
Compare
Choose a tag to compare

What's Changed

New Contributors

  • @dirvo made their first contribution in #37

Full Changelog: v1.7.0...v1.7.1