Skip to content
This repository has been archived by the owner on May 5, 2019. It is now read-only.

xcrash/essential-templating

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Essential Templating

Essential Templating is a set of libraries to render templated objects (like web pages or emails).

  • Provides easy to use template engine interface with C# 5.0 async methods.
  • Unified template location (now you can use files or .resx resources).
  • Localization support.

Essential.Templating.Razor

Template engine implementation based on [RazorEngine by Antaris]

Basic usage Template is located in "Hello.cshtml" file under "Templates" directory.

@inherits Essential.Templating.Razor.Template
Hello, @ViewBag.Name!

How to render the template?

ITemplateEngine engine = new RazorTemplateEngineBuilder()
                .FindTemplatesInDirectory("Templates")
                .CacheExpiresIn(TimeSpan.FromSeconds(20))
                .UseSharedCache()
                .Build();
string template = engine.Render(path: "Hello.cshtml", viewBag: new {Name = "John"});

What will we get as a result? Hello, John!

Essential.Templating.Razor.Email

Render razor pages as emails. See more at wiki.

To be continued... [RazorEngine by Antaris]:https://github.com/Antaris/RazorEngine

About

A set of templating libraries.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 93.5%
  • PowerShell 6.3%
  • Shell 0.2%