Skip to content

Commit

Permalink
- Bumped version to 1.9.0-rc.1
Browse files Browse the repository at this point in the history
- Updated README
  • Loading branch information
soundaranbu committed Nov 13, 2022
1 parent 1255bf3 commit 97a3fbd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This project makes use of [Razor SDK](https://docs.microsoft.com/en-us/aspnet/co

| | .NET Core 3.0 | .NET Core 3.1 | .NET 5 | .NET 6 |
|------------------|---------------|---------------|---------|--------------|
| Preferred Version| v1.6.0 | v1.6.0 | v1.6.0 | 1.8.0 |
| Preferred Version| v1.6.0 | v1.6.0 | v1.6.0 | 1.9.0-rc.1 |
| Console | ✓ | ✓ | ✓ | ✓ |
| Api | ✓ | ✓ | ✓ | ✓ |
| Mvc | ✓ | ✓ | ✓ | ✓ |
Expand Down Expand Up @@ -54,7 +54,7 @@ dotnet add package Razor.Templating.Core
```
##### Using Package Reference .csproj
```bash
<PackageReference Include="Razor.Templating.Core" Version="1.8.0" />
<PackageReference Include="Razor.Templating.Core" Version="1.9.0-rc.1" />
```

## Simple Usage:
Expand All @@ -79,6 +79,12 @@ var html = await RazorTemplateEngine.RenderAsync("/Views/ExampleView.cshtml", mo
```
Before applying this code, follow this article for sample implementation: https://medium.com/@soundaranbu/render-razor-view-cshtml-to-string-in-net-core-7d125f32c79


## Render View Without Layout
In case if there's a need to render a view without layout, use `RenderParitalAsync()` method.
```cs
var html = await RazorTemplateEngine.RenderPartialAsync("/Views/ExampleView.cshtml", model, viewDataOrViewBag);
```
## Razor Views in Library
Razor view files(.cshtml) can be organized in a separate shared Razor Class Libary(RCL). Sample library can be found [here](https://github.com/soundaranbu/RazorTemplating/tree/master/examples/Templates/ExampleAppRazorTemplates)

Expand Down
4 changes: 2 additions & 2 deletions src/Razor.Templating.Core/Razor.Templating.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
<Copyright />
<PackageProjectUrl>https://github.com/soundaranbu/RazorTemplating</PackageProjectUrl>
<Authors>Soundar Anbalagan</Authors>
<Version>1.8.0</Version>
<Version>1.9.0-rc.1</Version>
<RepositoryType>git</RepositoryType>
<PackageTags>razor-templating,html-templatingrazor,render,dotnet-core,core,template-engine,email,emails,razor-view-to-string-renderer, razor-view-engine</PackageTags>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
- Added IRazorTemplateEngine interface that can be used for constructor dependency injection instead of using a static class.
- Added `RenderPartialAsync` method to render views without layout
</PackageReleaseNotes>
<Nullable>Enable</Nullable>
</PropertyGroup>
Expand Down

0 comments on commit 97a3fbd

Please sign in to comment.