GitXplorerGitXplorer
c

RazorTemplateClassLibrary

public
6 stars
3 forks
0 issues

Commits

List of commits on branch master.
Unverified
ff919da2c302f7dffd36803ed414fd87b2d87739

Added update on VS2012 issues to readme

cconficient committed 11 years ago
Unverified
b7ce824250f9fe647594e425f775c579cad00e9c

Added RazorEngine to parse templates, and amended GenerateHtml to use this. I had to amend the template to use the full path in the @model declaration. Unit test now passes and generates the correct HTML.

cconficient committed 11 years ago
Unverified
410509809992d719be7a372825f58c92382666a3

Added code to fetch resource string

cconficient committed 11 years ago
Unverified
b607ed2fe4b2dad5a2d16ffebcd34867820f7fcb

Created OrderTemplate RazorView and specified it as EmbeddedResource

cconficient committed 11 years ago
Unverified
21dd31b13bb98e67c0c4d8fca355cab05fab68b8

Added the web.config file to the root folder. The only change to make here is the namespace of your own library

cconficient committed 11 years ago
Unverified
863693c253871a08fab6780b992d18cf0805c085

Added references to .NET assemblies for Linq and Abstractions

cconficient committed 11 years ago

README

The README file for this repository.

RazorTemplateClassLibrary

Updated for MVC5

Demonstrates amendments to C# class library to enable IDE support for Razor templates.

If you wish to create, edit and use Razor .cshtml (or .vbhtml) format documents outside of an ASP.NET web application, it is possible. This project shows the steps required to make it happen.

This library should be used in combination with my blog post ASP.NET Razor Views in Class Libraries on Wordpress.

I plan to create a commit at each set of changes, so you can see the finished product in the latest release and step back though each commit to see the changes made.

Update: This project was created in VS2013 but it can work in VS2012. However, since it uses MVC v5 and Razor v3 you must install the ASP.NET and Web Tools 2013.1 for Visual Studio 2012 for Intellisense to work in VS2012. This would be required for MVC5/Razor3 support anyway.