RazorTemplating Versions Save

Razor Templating Engine to render Razor Views(.cshtml files) to String in Console, Web, Service, Desktop workloads in .NET Core 3+

v2.0.0-rc.1

2 months ago

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: https://github.com/soundaranbu/Razor.Templating.Core/compare/v1.9.0...v2.0.0-rc.1

v1.9.0

9 months ago

What's Changed

New Contributors

NuGet

Full Changelog: https://github.com/soundaranbu/Razor.Templating.Core/compare/v1.8.0...v1.9.0

v.1.9.0-rc.2

1 year ago

What's Changed

NuGet

v1.9.0-rc.1

1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/soundaranbu/Razor.Templating.Core/compare/v1.8.0...v1.9.0-rc.1

NuGet

v1.8.0-rc.1

1 year ago

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: https://github.com/soundaranbu/Razor.Templating.Core/compare/v1.7.1...v1.8.0-rc.1

v1.7.1

1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/soundaranbu/RazorTemplating/compare/v1.7.0...v1.7.1

v1.7.1-rc.1

2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/soundaranbu/RazorTemplating/compare/v1.7.0...v1.7.1-rc.1

v1.6.1-rc.1

2 years ago

Changes:

Note:

  • This pre-release only supports upto .NET 5. Pre-release for 1.7.x which is for .NET 6 will be released later.

Full Changelog: https://github.com/soundaranbu/RazorTemplating/compare/v1.6.0...v1.6.1-rc.1