Razor.Templating.Core
1.1.0
Kindly update the package to v1.5.0 as some critical bugs were fixed in this version.
See the version list below for details.
dotnet add package Razor.Templating.Core --version 1.1.0
NuGet\Install-Package Razor.Templating.Core -Version 1.1.0
<PackageReference Include="Razor.Templating.Core" Version="1.1.0" />
paket add Razor.Templating.Core --version 1.1.0
#r "nuget: Razor.Templating.Core, 1.1.0"
// Install Razor.Templating.Core as a Cake Addin
#addin nuget:?package=Razor.Templating.Core&version=1.1.0
// Install Razor.Templating.Core as a Cake Tool
#tool nuget:?package=Razor.Templating.Core&version=1.1.0
Razor Templating
Using Razor for HTML templating was never been so easy like this.
- Works for .NET Core 3.0, 3.1
- Works in Console Application, ASP.NET Core Application Independently
This project makes use of Razor SDK for precompiling the views.
Applications
- Email Templating
- Report Generation & so on
Example:
var model = new ExampleModel()
{
PlainText = "Some text",
HtmlContent = "<em>Some emphasized text</em>"
};
var viewData = new Dictionary<string, object>();
viewData["Value1"] = "1";
viewData["Value2"] = "2";
var html = await RazorTemplateEngine.RenderAsync("/Views/ExampleView.cshtml", model, viewData);
Note:
- Please ensure that the views path is always unique among all the shared template projects.
References:
Thanks to all the great articles which helped to bring this library out!
- https://github.com/Andy9FromSpace/razor-renderer-core
- https://github.com/aspnet/Entropy/tree/master/samples/Mvc.RenderViewToString
- https://www.frakkingsweet.com/razor-template-rendering/
- https://github.com/veccsolutions/RenderRazorConsole
- https://emilol.com/razor-mailer/
- https://codeopinion.com/using-razor-in-a-console-application/
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows |
.NET Core | netcoreapp3.1 |
-
.NETCoreApp 3.1
NuGet packages (10)
Showing the top 5 NuGet packages that depend on Razor.Templating.Core:
Package | Downloads |
---|---|
Sitko.Core.App.Web
Sitko.Core is a set of libraries to help build .NET Core applications fast |
|
FenixAlliance.ACL.Dependencies
Application Component for the Alliance Business Suite. |
|
Digizuite.Optimizely
The official integration between Digizuite DAM and Optimizely CMS. |
|
FinancialModuleAuxiliary
Package Description |
|
Unlog.AspNetCore
the aspnetcore package for UnLog |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
1.9.0-rc.2 | 208 | 2/25/2023 | |
1.9.0-rc.1 | 10,703 | 11/13/2022 | |
1.8.0 | 105,390 | 11/5/2022 | |
1.8.0-rc.1 | 4,524 | 9/17/2022 | |
1.7.1 | 266,848 | 7/2/2022 | |
1.7.1-rc.1 | 9,232 | 2/20/2022 | |
1.7.0 | 491,130 | 11/13/2021 | |
1.7.0-preview.1 | 2,130 | 9/26/2021 | |
1.6.1-rc.1 | 2,699 | 1/13/2022 | |
1.6.0 | 296,286 | 9/26/2021 | |
1.6.0-rc.2 | 5,523 | 5/14/2021 | |
1.6.0-rc.1 | 430 | 5/13/2021 | |
1.5.0 | 257,301 | 2/27/2021 | |
1.4.0 | 67,437 | 12/5/2020 | |
1.4.0-rc.1 | 584 | 11/19/2020 | |
1.3.0 | 8,041 | 11/17/2020 | |
1.2.1 | 25,585 | 9/21/2020 | |
1.2.0 | 3,400 | 7/11/2020 | |
1.1.2 | 1,495 | 4/13/2020 | |
1.1.0 | 485 | 4/13/2020 | |
1.0.1 | 714 | 4/3/2020 | |
1.0.0 | 661 | 4/3/2020 |